Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix dtype promotion in SEVIRI native reader #2983

Merged
merged 2 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
1 change: 1 addition & 0 deletions satpy/tests/reader_tests/test_seviri_l1b_native.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python

Check notice on line 1 in satpy/tests/reader_tests/test_seviri_l1b_native.py

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main)

ℹ Getting worse: Lines of Code in a Single File

The lines of code increases from 660 to 661, improve code health by reducing it to 600. The number of Lines of Code in a single file. More Lines of Code lowers the code health.
# -*- coding: utf-8 -*-
# Copyright (c) 2017-2019 Satpy developers
#
Expand Down Expand Up @@ -1314,6 +1314,7 @@
with warnings.catch_warnings():
warnings.filterwarnings("ignore", category=UserWarning)
scene.load(["VIS006"])
assert scene["VIS006"].dtype == np.float32
assert scene["VIS006"].shape == (3712, 3712)
assert isinstance(scene["VIS006"], xr.core.dataarray.DataArray)

Expand Down
Loading