Skip to content

Commit

Permalink
Fix solar_flux 64-bit float causing upcasting in NIR reflectance calc…
Browse files Browse the repository at this point in the history
…ulations
  • Loading branch information
djhoese committed Jun 27, 2024
1 parent 3152387 commit 239c410
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pyspectral/near_infrared_reflectance.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ def reflectance_from_tbs(self, sun_zenith, tb_near_ir, tb_thermal, **kwargs):
mu0 = np.cos(np.deg2rad(sunz))

# mu0 = np.where(np.less(mu0, 0.1), 0.1, mu0)
self._solar_radiance = self.solar_flux * mu0 / np.pi
self._solar_radiance = (self.solar_flux * mu0 / np.pi).astype(tb_nir.dtype)

# CO2 correction to the 3.9 radiance, only if tbs of a co2 band around
# 13.4 micron is provided:
Expand Down

0 comments on commit 239c410

Please sign in to comment.