Commit 38772e09 authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

Added a GUI test mode to EnPTController. Added keywords to setup.py.


Signed-off-by: Daniel Scheffler's avatarDaniel Scheffler <danschef@gfz-potsdam.de>
parent 9c796dba
Pipeline #7857 passed with stages
in 57 minutes and 41 seconds
......@@ -35,6 +35,7 @@ import zipfile
import shutil
import weakref
import warnings
import pickle
from ..options.config import EnPTConfig
from ..io.reader import L1B_Reader
......@@ -142,23 +143,39 @@ class EnPT_Controller(object):
def run_all_processors(self):
"""Run all processors at once."""
try:
self.read_L1B_data()
if self.cfg.run_deadpix_P:
self.L1_obj.correct_dead_pixels()
# self.run_toaRad2toaRef() # this is only needed for geometry processor but AC expects radiance
self.run_dem_processor()
if self.cfg.enable_ac:
self.run_atmospheric_correction()
else:
self.L1_obj.logger.info('Skipping atmospheric correction as configured and '
'computing top-of-atmosphere reflectance instead.')
self.run_toaRad2toaRef()
self.run_geometry_processor()
self.run_orthorectification()
self.write_output()
finally:
self.cleanup()
if os.getenv('IS_ENPT_GUI_TEST') != "1":
try:
self.read_L1B_data()
if self.cfg.run_deadpix_P:
self.L1_obj.correct_dead_pixels()
# self.run_toaRad2toaRef() # this is only needed for geometry processor but AC expects radiance
self.run_dem_processor()
if self.cfg.enable_ac:
self.run_atmospheric_correction()
else:
self.L1_obj.logger.info('Skipping atmospheric correction as configured and '
'computing top-of-atmosphere reflectance instead.')
self.run_toaRad2toaRef()
self.run_geometry_processor()
self.run_orthorectification()
self.write_output()
finally:
self.cleanup()
else:
print('EnPT Controller received the following configuration:')
print(repr(self.cfg))
if not os.path.isdir(self.cfg.output_dir):
raise NotADirectoryError(self.cfg.output_dir)
with open(os.path.join(self.cfg.output_dir, 'received_args_kwargs.pkl')) as outF:
pickle.dump(
dict(
json_config=self.cfg.json_config,
kwargs=self.cfg.kwargs
),
outF)
@classmethod
def _cleanup(cls, tempDir, warn_message):
......
......@@ -69,7 +69,7 @@ setup(
zip_safe=False,
scripts=['bin/enpt_cli.py'],
data=[], # TODO
keywords='enpt',
keywords=['EnPT', 'EnMAP', 'EnMAP-Box', 'hyperspectral', 'remote sensing', 'satellite', 'processing chain'],
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
......
Supports Markdown
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