Skip to content

Commit

Permalink
include comments, create fixture_time_fake_dataset()
Browse files Browse the repository at this point in the history
  • Loading branch information
bkremmli committed Sep 24, 2024
1 parent 89d9931 commit 7d0ecef
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions satpy/tests/reader_tests/test_mviri_l1b_fiduceo_nc.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
# The following fixtures are not defined in this file, but are used and injected by Pytest:
# - request

fill_val = np.int64("4294967295")
fill_val = np.int64("4294967295") # needs to be defined as int64 for windows

attrs_exp: dict = {
"platform": "MET7",
Expand Down Expand Up @@ -256,13 +256,18 @@
height=2
)

time_fake_dataset = np.arange(4) * 60 * 60
time_fake_dataset[0] = fill_val
time_fake_dataset[1] = fill_val
time_fake_dataset = time_fake_dataset.reshape(2, 2)
@pytest.fixture(name="time_fake_dataset")
def fixture_time_fake_dataset():
"""Create time for fake dataset."""
time = np.arange(4) * 60 * 60
time[0] = fill_val
time[1] = fill_val
time = time.reshape(2, 2)

return time

@pytest.fixture(name="fake_dataset")
def fixture_fake_dataset():
def fixture_fake_dataset(time_fake_dataset):
"""Create fake dataset."""
count_ir = da.linspace(0, 255, 4, dtype=np.uint8).reshape(2, 2)
count_wv = da.linspace(0, 255, 4, dtype=np.uint8).reshape(2, 2)
Expand All @@ -281,7 +286,6 @@ def fixture_fake_dataset():
)

cov = da.from_array([[1, 2], [3, 4]])
time = time_fake_dataset

ds = xr.Dataset(
data_vars={
Expand All @@ -293,7 +297,7 @@ def fixture_fake_dataset():
"u_structured_toa_bidirectional_reflectance": u_vis_refl_exp / 100,
"quality_pixel_bitmask": (("y", "x"), mask),
"solar_zenith_angle": (("y_tie", "x_tie"), sza),
"time_ir_wv": (("y_ir_wv", "x_ir_wv"), time),
"time_ir_wv": (("y_ir_wv", "x_ir_wv"), time_fake_dataset),
"a_ir": -5.0,
"b_ir": 1.0,
"bt_a_ir": 10.0,
Expand Down

0 comments on commit 7d0ecef

Please sign in to comment.