Commit 2b1d9a1c authored by Daniel Scheffler's avatar Daniel Scheffler

Fixed an issue causing the L2B/L2C output to contain wrong spectral bands in...

Fixed an issue causing the L2B/L2C output to contain  wrong spectral bands in case the spectral homogenization is executed and sort_by_cwl is set to True (due to a wrong wavelength order if no_pan=False).
Signed-off-by: Daniel Scheffler's avatarDaniel Scheffler <danschef@gfz-potsdam.de>
parent b436e67b
...@@ -75,10 +75,12 @@ class L2B_object(L2A_object): ...@@ -75,10 +75,12 @@ class L2B_object(L2A_object):
tgt_fwhm = CFG.target_FWHM tgt_fwhm = CFG.target_FWHM
else: else:
# exclude those bands from CFG.target_CWL and CFG.target_FWHM that have been removed after AC # exclude those bands from CFG.target_CWL and CFG.target_FWHM that have been removed after AC
full_LBA = get_LayerBandsAssignment( full_LBA = get_LayerBandsAssignment(GMS_identifier(proc_level='L1A', **tgt_gmsid_kw),
GMS_identifier(satellite=tgt_sat, sensor=tgt_sen, subsystem='', no_thermal=True,
image_type='RSD', proc_level='L1A', dataset_ID=src_dsID, logger=None), no_pan=False,
no_thermal=True, no_pan=False, return_fullLBA=True, sort_by_cwl=True, proc_level='L1A') return_fullLBA=True,
sort_by_cwl=True,
proc_level='L1A')
tgt_cwl = [dict(zip(full_LBA, CFG.target_CWL))[bN] for bN in tgt_LBA] tgt_cwl = [dict(zip(full_LBA, CFG.target_CWL))[bN] for bN in tgt_LBA]
tgt_fwhm = [dict(zip(full_LBA, CFG.target_FWHM))[bN] for bN in tgt_LBA] tgt_fwhm = [dict(zip(full_LBA, CFG.target_FWHM))[bN] for bN in tgt_LBA]
...@@ -88,7 +90,7 @@ class L2B_object(L2A_object): ...@@ -88,7 +90,7 @@ class L2B_object(L2A_object):
if self.dataset_ID == CFG.datasetid_spectral_ref: if self.dataset_ID == CFG.datasetid_spectral_ref:
self.logger.info("Spectral homogenization has been skipped because the dataset id equals the dataset id of " self.logger.info("Spectral homogenization has been skipped because the dataset id equals the dataset id of "
"the spectral refernce sensor.") "the spectral reference sensor.")
return return
if src_cwls == CFG.target_CWL or (self.satellite == tgt_sat and self.sensor == tgt_sen): if src_cwls == CFG.target_CWL or (self.satellite == tgt_sat and self.sensor == tgt_sen):
......
...@@ -2203,8 +2203,9 @@ def get_LayerBandsAssignment(GMS_id, nBands=None, sort_by_cwl=None, no_thermal=N ...@@ -2203,8 +2203,9 @@ def get_LayerBandsAssignment(GMS_id, nBands=None, sort_by_cwl=None, no_thermal=N
dict_cwlSorted_LayerBandsAssignment = { dict_cwlSorted_LayerBandsAssignment = {
'TM4': ['1', '2', '3', '4', '5', '7', '6'], 'TM4': ['1', '2', '3', '4', '5', '7', '6'],
'TM5': ['1', '2', '3', '4', '5', '7', '6'], 'TM5': ['1', '2', '3', '4', '5', '7', '6'],
'TM7': ['1', '2', '3', '4', '5', '7', '8', '6L', '6H'], 'TM7': ['1', '2', '3', '8', '4', '5', '7', '6L', '6H'],
'LDCM': ['1', '2', '3', '4', '5', '9', '6', '7', '8', '10', '11'], } 'LDCM': ['1', '2', '3', '8', '4', '5', '9', '6', '7', '10', '11'],
}
if nBands is None or nBands == len(dict_LayerBandsAssignment[GMS_sensorcode]): if nBands is None or nBands == len(dict_LayerBandsAssignment[GMS_sensorcode]):
assert GMS_sensorcode in dict_LayerBandsAssignment, \ assert GMS_sensorcode in dict_LayerBandsAssignment, \
......
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