IndexError in case EnPT_Controller is called with an EnMAP image in the official DLR format.
Calling the EnPT controller with an EnMAP image in the official DLR format raises an IndexError.
from enpt.execution.controller import EnPT_Controller
CTR = EnPT_Controller(path_l1b_enmap_image='/path/to/'
'ENMAP01-____L1B-DT000000987_20130205T105307Z_001_V000003_20181214T160003Z__rows0-99.zip',
is_test=True
)
CTR.run_all_processors()
---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
<ipython-input-9-07801111816c> in <module>
5 # is_dlr_dataformat=True
6 )
----> 7 CTR.run_all_processors()
~/scheffler/python_deployed/EnPT/enpt/execution/controller.py in run_all_processors(self)
116 """Run all processors at once."""
117 try:
--> 118 self.read_L1B_data()
119 if self.cfg.run_deadpix_P:
120 self.L1_obj.correct_dead_pixels()
~/scheffler/python_deployed/EnPT/enpt/execution/controller.py in read_L1B_data(self)
78 RD = L1B_Reader(config=self.cfg)
79 self.L1_obj = RD.read_inputdata(root_dir_main=path_enmap_image, root_dir_ext=path_enmap_image_gapfill,
---> 80 n_line_ext=self.cfg.n_lines_to_append)
81
82 def run_toaRad2toaRef(self):
~/scheffler/python_deployed/EnPT/enpt/io/reader.py in read_inputdata(self, root_dir_main, root_dir_ext, n_line_ext, compute_snr)
56
57 # Get a new instance of the EnMAPL1Product_SensorGeo for the main image
---> 58 l1b_main_obj = EnMAPL1Product_SensorGeo(root_dir_main, config=self.cfg, logger=self.logger)
59
60 # associate raster attributes with file links (raster data is read lazily / on demand)
~/scheffler/python_deployed/EnPT/enpt/model/images.py in __init__(self, root_dir, config, logger)
625 config=self.cfg, logger=self.logger)
626 else:
--> 627 self.meta = EnMAP_Metadata_L1B_SensorGeo(glob(path.join(root_dir, "*_header.xml"))[0],
628 config=self.cfg, logger=self.logger)
629 self.meta.read_metadata()
IndexError: list index out of range
Solution:
- set 'is_dlr_dataformat' to True by default
- improve detection of missing or inplausible input parameters