Skip to content

Commit

Permalink
Merge pull request #37 from pytroll/bugfix-multiple-rsr-downloads
Browse files Browse the repository at this point in the history
Interface fix: If wavelength in float is provided, assume it is an "e…
  • Loading branch information
adybbroe committed Jun 1, 2018
2 parents 337f7ee + 88c48af commit 3937586
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions pyspectral/rayleigh.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,17 @@ def get_reflectance_lut(self):
return self._rayl, self._wvl_coord, self._azid_coord,\
self._satz_sec_coord, self._sunz_sec_coord

def get_reflectance(self, sun_zenith, sat_zenith, azidiff, bandname,
redband=None):
"""Get the reflectance from the three sun-sat angles."""
def get_reflectance(self, sun_zenith, sat_zenith, azidiff, bandname, redband=None):
"""Get the reflectance from the three sun-sat angles"""
# Get wavelength in nm for band:
wvl = self.get_effective_wavelength(bandname) * 1000.0
if isinstance(bandname, float):
LOG.warning('A wavelength is provided instead of band name - ' +
'disregard the relative spectral responses and assume ' +
'it is the effective wavelength: %f (micro meter)', bandname)
wvl = bandname * 1000.0
else:
wvl = self.get_effective_wavelength(bandname) * 1000.0

rayl, wvl_coord, azid_coord, satz_sec_coord, sunz_sec_coord = \
self.get_reflectance_lut()

Expand Down

0 comments on commit 3937586

Please sign in to comment.