Commit 7dc0930a authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

Fix for FileNotFoundError during DEM generation in test mode.

updated __version__ and __versionalias__
Former-commit-id: 7ded2dfe
Former-commit-id: 3b3a804f
parent dcefa684
......@@ -2,8 +2,8 @@
__author__ = """Daniel Scheffler"""
__email__ = 'daniel.scheffler@gfz-potsdam.de'
__version__ = '0.4.2'
__versionalias__ = '20170630.01'
__version__ = '0.4.3'
__versionalias__ = '20170630.02'
from . import algorithms
......
......@@ -649,13 +649,24 @@ class AtmCorr(object):
if re.search('Sentinel-2', self.inObjs[0].satellite):
# in case of Sentinel-2 the 20m DEM must be passed
inObj4dem = [obj for obj in self.inObjs if obj.arr.xgsd==20]
assert inObj4dem, self.logger.warning('Sentinel-2 20m subsystem could not be found. DEM passed to '
'atmospheric correction might have wrong resolution.')
if not inObj4dem:
self.logger.warning('Sentinel-2 20m subsystem could not be found. DEM passed to '
'atmospheric correction might have wrong resolution.')
inObj4dem = inObj4dem[0]
else:
inObj4dem = self.inObjs[0]
return inObj4dem.dem[:].astype(np.float32)
try:
dem = inObj4dem.dem[:].astype(np.float32)
except Exception as e:
dem = None
self.logger.warning('A static elevation is assumed during atmosheric correction due to an error during '
'creation of the DEM corresponding to scene %s (entity ID: %s). Error message was: '
'\n%s\n' % (self.inObjs[0].scene_ID, self.inObjs[0].entity_ID, repr(e)))
self.logger.info("Print traceback in case you care:")
self.logger.info(traceback.format_exc())
return dem
def _get_srf(self):
......@@ -767,10 +778,10 @@ class AtmCorr(object):
self.logger.error('\nAn error occurred during atmospheric correction. BE AWARE THAT THE SCENE %s '
'(ENTITY ID %s) HAS NOT BEEN ATMOSPHERICALLY CORRECTED! Error message was: \n%s\n'
%(self.inObjs[0].scene_ID, self.inObjs[0].entity_ID, repr(e)) )
% (self.inObjs[0].scene_ID, self.inObjs[0].entity_ID, repr(e)))
self.logger.error("Print traceback in case you care:")
self.logger.error(traceback.format_exc())
# TODO include that in the job summary!
# TODO include that in the job summary
return list(self.inObjs)
......
......@@ -22,7 +22,7 @@ test_requirements = requirements+ ['coverage']
setup(
name='geomultisens',
version='0.4.2',
version='0.4.3',
description="GeoMultiSens - Scalable Multi-Sensor Analysis of Remote Sensing Data",
long_description=readme + '\n\n' + history,
author="Daniel Scheffler",
......
......@@ -97,7 +97,8 @@ class Test_Landsat8_PreCollectionDataNew_NewFormat(BaseTestCases.TestAll):
job_config_kwargs = dict(
path_archive=os.path.join(gmsRepo_rootpath, 'tests', 'data', 'archive_data'),
path_procdata_scenes=os.path.join(gmsRepo_rootpath, 'tests', 'data', 'output_scenes'),
path_procdata_MGRS=os.path.join(gmsRepo_rootpath, 'tests', 'data', 'output_mgrs_tiles'))
path_procdata_MGRS=os.path.join(gmsRepo_rootpath, 'tests', 'data', 'output_mgrs_tiles'),
is_test = True)
cls.PC = process_controller(26186261, parallelization_level='scenes', db_host='geoms',
delete_old_output=True,
......@@ -113,7 +114,8 @@ class Test_Landsat7_SLC_on_OldFormat(BaseTestCases.TestAll):
job_config_kwargs = dict(
path_archive=os.path.join(gmsRepo_rootpath, 'tests', 'data', 'archive_data'),
path_procdata_scenes=os.path.join(gmsRepo_rootpath, 'tests', 'data', 'output_scenes'),
path_procdata_MGRS=os.path.join(gmsRepo_rootpath, 'tests', 'data', 'output_mgrs_tiles'))
path_procdata_MGRS=os.path.join(gmsRepo_rootpath, 'tests', 'data', 'output_mgrs_tiles'),
is_test = True)
cls.PC = process_controller(26186262, parallelization_level='scenes', db_host='geoms',
delete_old_output=True,
......@@ -129,7 +131,8 @@ class Test_Landsat5_OldFormat(BaseTestCases.TestAll):
job_config_kwargs = dict(
path_archive=os.path.join(gmsRepo_rootpath, 'tests', 'data', 'archive_data'),
path_procdata_scenes=os.path.join(gmsRepo_rootpath, 'tests', 'data', 'output_scenes'),
path_procdata_MGRS=os.path.join(gmsRepo_rootpath, 'tests', 'data', 'output_mgrs_tiles'))
path_procdata_MGRS=os.path.join(gmsRepo_rootpath, 'tests', 'data', 'output_mgrs_tiles'),
is_test = True)
cls.PC = process_controller(26186263, parallelization_level='scenes', db_host='geoms',
delete_old_output=True,
......
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