Skip to content

Commit

Permalink
Merge pull request #2983 from pkhalaj/bugfix/seviri-reader-numpy2
Browse files Browse the repository at this point in the history
Fix dtype promotion in SEVIRI native reader
  • Loading branch information
mraspaud authored Nov 20, 2024
2 parents c214917 + da84875 commit b00303e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion satpy/readers/seviri_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,7 @@ def calibrate(self, data, calibration):
"brightness_temperature"]:
gain, offset = self.get_gain_offset()
res = self._algo.convert_to_radiance(
data.astype(np.float32), gain, offset
data.astype(np.float32), np.float32(gain), np.float32(offset)
)
else:
raise ValueError(
Expand Down
2 changes: 2 additions & 0 deletions satpy/tests/reader_tests/test_seviri_l1b_native.py
Original file line number Diff line number Diff line change
Expand Up @@ -1314,6 +1314,8 @@ def test_read_physical_seviri_nat_file(full_path):
with warnings.catch_warnings():
warnings.filterwarnings("ignore", category=UserWarning)
scene.load(["VIS006"])
assert scene["VIS006"].dtype == np.float32
assert scene["VIS006"].values.dtype == np.float32
assert scene["VIS006"].shape == (3712, 3712)
assert isinstance(scene["VIS006"], xr.core.dataarray.DataArray)

Expand Down

0 comments on commit b00303e

Please sign in to comment.