Skip to content

Commit

Permalink
Fixing unit test on onboard_utc
Browse files Browse the repository at this point in the history
  • Loading branch information
GMV - Emmanuel Roche committed Feb 4, 2025
1 parent 0ada7c4 commit b1c5e4c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion satpy/readers/iasi_ng_l2_nc.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ def convert_to_datetime(self, data_array, ds_info):
# Note: converting the time values to ns precision to avoid warnings
# from panda+numpy:
data_array = xr.DataArray(
data=pd.to_datetime(epoch) + (data_array * 1e9).astype("timedelta64[ns]"),
data=pd.to_datetime(epoch) + data_array.astype("timedelta64[ns]") * 1e9,
dims=data_array.dims,
attrs=data_array.attrs,
)
Expand Down
20 changes: 10 additions & 10 deletions satpy/tests/reader_tests/test_iasi_ng_l2_nc.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,20 +327,20 @@ def test_latlon_datasets(self, twv_scene):
assert np.nanmin(lon) >= -180.0
assert np.nanmax(lon) <= 180.0

# def test_onboard_utc_dataset(self, twv_scene):
# """Test loading the onboard_utc dataset."""
# twv_scene.load(["onboard_utc", "sounder_pixel_latitude"])
# dset = twv_scene["onboard_utc"]
def test_onboard_utc_dataset(self, twv_scene):
"""Test loading the onboard_utc dataset."""
twv_scene.load(["onboard_utc", "sounder_pixel_latitude"])
dset = twv_scene["onboard_utc"]

# assert len(dset.dims) == 2
# assert dset.dims[0] == "x"
# assert dset.dims[1] == "y"
assert len(dset.dims) == 2
assert dset.dims[0] == "x"
assert dset.dims[1] == "y"

# assert dset.dtype == np.dtype("datetime64[ns]")
assert dset.dtype == np.dtype("datetime64[ns]")

# lat = twv_scene["sounder_pixel_latitude"]
lat = twv_scene["sounder_pixel_latitude"]

# assert lat.shape == dset.shape
assert lat.shape == dset.shape

def test_nbr_iterations_dataset(self, twv_scene):
"""Test loading the nbr_iterations dataset."""
Expand Down

0 comments on commit b1c5e4c

Please sign in to comment.