-
-
Notifications
You must be signed in to change notification settings - Fork 573
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update test helper to use bscale if its present
- Loading branch information
Showing
4 changed files
with
28 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from pathlib import Path | ||
|
||
import numpy as np | ||
|
||
from sunpy.data.test import get_dummy_map_from_header, get_test_filepath | ||
|
||
TEST_IRIS_SJI_HEADER = get_test_filepath('iris_l2_20130801_074720_4040000014_SJI_1400_t000.header') | ||
|
||
def test_get_dummy_map_from_header_b_scale_zero_applied(): | ||
# We use the IRIS one since it contains a BZERO and BSCALE in the test header | ||
iris_map = get_dummy_map_from_header(Path(TEST_IRIS_SJI_HEADER)) | ||
assert iris_map.meta["bscale"] == 0.25 | ||
assert iris_map.meta["bzero"] == 7992 | ||
# Data from the test header is scaled by BSCALE and BZERO | ||
# but the max value it will return is 100 and converted to int | ||
# So its 24 instead of 25 due to the rounding | ||
assert np.max(iris_map.data) == 8016 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters