Skip to content

Commit

Permalink
Fix accidental dtype upcasting in seviri l1b calibration
Browse files Browse the repository at this point in the history
  • Loading branch information
djhoese committed Nov 2, 2023
1 parent b10828b commit 5358021
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions satpy/readers/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ def apply_earthsun_distance_correction(reflectance, utc_date=None):
reflectance.attrs["sun_earth_distance_correction_applied"] = True
reflectance.attrs["sun_earth_distance_correction_factor"] = sun_earth_dist
with xr.set_options(keep_attrs=True):
reflectance = reflectance * sun_earth_dist * sun_earth_dist
reflectance = reflectance * reflectance.dtype.type(sun_earth_dist * sun_earth_dist)
return reflectance


Expand All @@ -472,5 +472,5 @@ def remove_earthsun_distance_correction(reflectance, utc_date=None):
reflectance.attrs["sun_earth_distance_correction_applied"] = False
reflectance.attrs["sun_earth_distance_correction_factor"] = sun_earth_dist
with xr.set_options(keep_attrs=True):
reflectance = reflectance / (sun_earth_dist * sun_earth_dist)
reflectance = reflectance / reflectance.dtype.type(sun_earth_dist * sun_earth_dist)
return reflectance

0 comments on commit 5358021

Please sign in to comment.