Commit f79cd38d authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

Merge branch 'bugfix/fix_LBA_bandnames' into 'master'

Fixed missing LayerBandsAssignment and wrong bandnames.

See merge request !1
parents 6899a35d 2f83c993
Pipeline #4604 passed with stages
in 2 minutes and 58 seconds
......@@ -62,12 +62,12 @@ def RSR_reader(satellite, sensor, subsystem='',
LBA = LayerBandsAssignment or get_LayerBandsAssignment(satellite, sensor, subsystem,
no_thermal=no_thermal, no_pan=no_pan,
sort_by_cwl=sort_by_cwl, after_ac=after_ac)
bandnames = ['band_%s' % b for b in LBA]
for bandname in bandnames:
for band in LBA:
bandname = 'band_%s' % band
RSR_path = os.path.join(RSR_dir, bandname)
try:
RSR_dict[bandname] = np.loadtxt(RSR_path, skiprows=1)
RSR_dict[band] = np.loadtxt(RSR_path, skiprows=1)
if v:
print('Reading RSR for %s %s, %s...' % (satellite, sensor, bandname))
except FileNotFoundError:
......@@ -147,6 +147,7 @@ class RelativeSpectralResponse(object):
for band in rsr_dict: # = OrderedDict -> order follows LayerBandsAssignment
bandname = band if not self.format_bandnames else ('B%s' % band if len(band) == 2 else 'B0%s' % band)
bandnames.append(bandname)
self.LayerBandsAssignment.append(band)
rsrs = rsr_dict[band][:, 1]
wvls = np.array(rsr_dict[band][:, 0] * scale_factor)
......
......@@ -22,5 +22,5 @@
# with this program. If not, see <http://www.gnu.org/licenses/>.
__version__ = '0.2.7'
__versionalias__ = '20190822.09'
__version__ = '0.2.8'
__versionalias__ = '20190823.01'
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment