Commit 11935e0e authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

Fixed missing bandnames in written accuracy layers.

Updated minimal version of GeoArray to 0.7.13.
Enabled accuracy layer generation during tests.
Updated version info (0.14.4).
parent d9df7b0c
...@@ -703,34 +703,6 @@ class GMS_object(object): ...@@ -703,34 +703,6 @@ class GMS_object(object):
@property @property
def accuracy_layers(self): def accuracy_layers(self):
if not self._accuracy_layers:
if not self.proc_level.startswith('L2'):
self.logger.warning('Attempt to get %s accuracy layers failed - they are a Level 2 feature only.'
% self.proc_level)
return None
try:
from ..algorithms.L2C_P import AccuracyCube
self._accuracy_layers = AccuracyCube(self)
except ValueError as e:
if str(e) == 'The given GMS_object contains no accuracy layers for combination.':
if any([CFG.ac_estimate_accuracy, CFG.spathomo_estimate_accuracy, CFG.spechomo_estimate_accuracy]):
if self.proc_level == 'L2C':
self.logger.warning('The given GMS_object contains no accuracy layers although computation '
'of accurracy layers was enabled in job configuration.')
else:
# Suppress the warning if accuracy_layers is just called by GMS_object.to_tiles() within
# L2A or L2B processing.
pass
else:
pass # self._accuracy_layers keeps None
else:
raise
except Exception as e:
raise RuntimeError('Failed to generate AccuracyCube!', e)
return self._accuracy_layers return self._accuracy_layers
@accuracy_layers.setter @accuracy_layers.setter
...@@ -769,6 +741,29 @@ class GMS_object(object): ...@@ -769,6 +741,29 @@ class GMS_object(object):
else: else:
return None return None
def generate_accuracy_layers(self):
if not self.proc_level.startswith('L2'):
self.logger.warning('Attempt to get %s accuracy layers failed - they are a Level 2 feature only.'
% self.proc_level)
return None
try:
from ..algorithms.L2C_P import AccuracyCube
self._accuracy_layers = AccuracyCube(self) # don't use setter because it sets it to a GeoArray instance
except ValueError as e:
if str(e) == 'The given GMS_object contains no accuracy layers for combination.':
if any([CFG.ac_estimate_accuracy, CFG.spathomo_estimate_accuracy, CFG.spechomo_estimate_accuracy]):
self.logger.warning('The given GMS_object contains no accuracy layers although computation '
'of accurracy layers was enabled in job configuration.')
else:
pass # self._accuracy_layers keeps None
else:
raise
except Exception as e:
raise RuntimeError('Failed to generate AccuracyCube!', e)
@property @property
def cloud_masking_algorithm(self): def cloud_masking_algorithm(self):
if not self._cloud_masking_algorithm: if not self._cloud_masking_algorithm:
...@@ -1841,6 +1836,9 @@ class GMS_object(object): ...@@ -1841,6 +1836,9 @@ class GMS_object(object):
if self.proc_level == 'L2C': if self.proc_level == 'L2C':
if CFG.ac_estimate_accuracy or CFG.spathomo_estimate_accuracy or CFG.spechomo_estimate_accuracy: if CFG.ac_estimate_accuracy or CFG.spathomo_estimate_accuracy or CFG.spechomo_estimate_accuracy:
attributes2write.append('accuracy_layers') attributes2write.append('accuracy_layers')
# generate accuracy layers to be written
self.generate_accuracy_layers()
else: else:
self.logger.info('Accuracy layers are not written because their generation has been disabled in the ' self.logger.info('Accuracy layers are not written because their generation has been disabled in the '
'job configuration.') 'job configuration.')
......
__version__ = '0.14.3' __version__ = '0.14.4'
__versionalias__ = '20180315.04' __versionalias__ = '20180315.05'
py_tools_ds>=0.12.4 py_tools_ds>=0.12.4
geoarray>=0.7.12 geoarray>=0.7.13
arosics>=0.6.6 arosics>=0.6.6
git+https://gitext.gfz-potsdam.de/EnMAP/sicor.git git+https://gitext.gfz-potsdam.de/EnMAP/sicor.git
matplotlib matplotlib
......
...@@ -18,7 +18,7 @@ with open("gms_preprocessing/version.py") as version_file: ...@@ -18,7 +18,7 @@ with open("gms_preprocessing/version.py") as version_file:
requirements = [ requirements = [
'matplotlib', 'numpy', 'scikit-learn', 'scipy', 'gdal', 'pyproj', 'shapely', 'ephem', 'pyorbital', 'dill', 'pytz', 'matplotlib', 'numpy', 'scikit-learn', 'scipy', 'gdal', 'pyproj', 'shapely', 'ephem', 'pyorbital', 'dill', 'pytz',
'pandas', 'numba', 'spectral>=0.16', 'geopandas', 'iso8601', 'pyinstrument', 'geoalchemy2', 'sqlalchemy', 'pandas', 'numba', 'spectral>=0.16', 'geopandas', 'iso8601', 'pyinstrument', 'geoalchemy2', 'sqlalchemy',
'psycopg2', 'py_tools_ds>=0.12.4', 'geoarray>=0.7.12', 'arosics>=0.6.6', 'six', 'tqdm', 'jsmin', 'cerberus', 'psycopg2', 'py_tools_ds>=0.12.4', 'geoarray>=0.7.13', 'arosics>=0.6.6', 'six', 'tqdm', 'jsmin', 'cerberus',
'nested_dict', 'openpyxl', 'timeout_decorator', 'redis', 'redis-semaphore', 'python-redis-lock', 'psutil' 'nested_dict', 'openpyxl', 'timeout_decorator', 'redis', 'redis-semaphore', 'python-redis-lock', 'psutil'
# spectral<0.16 has some problems with writing signed integer 8bit data # spectral<0.16 has some problems with writing signed integer 8bit data
# fmask # conda install -c conda-forge python-fmask # fmask # conda install -c conda-forge python-fmask
......
...@@ -79,7 +79,7 @@ dependencies: ...@@ -79,7 +79,7 @@ dependencies:
- python-redis-lock - python-redis-lock
- psutil - psutil
- py_tools_ds>=0.12.4 - py_tools_ds>=0.12.4
- geoarray>=0.7.12 - geoarray>=0.7.13
- arosics>=0.6.6 - arosics>=0.6.6
# sicor # sicor
......
...@@ -108,8 +108,9 @@ class BaseTestCases: ...@@ -108,8 +108,9 @@ class BaseTestCases:
[cls.validate_db_entry(ds['filename']) for ds in cls.PC.config.data_list] [cls.validate_db_entry(ds['filename']) for ds in cls.PC.config.data_list]
cls.PC.config.ac_estimate_accuracy = True # FIXME cls.PC.config.ac_estimate_accuracy = True
cls.PC.config.spechomo_estimate_accuracy = True # FIXME cls.PC.config.spathomo_estimate_accuracy = True
cls.PC.config.spechomo_estimate_accuracy = True
def check_availability(self, GMS_objs, tgt_procL): def check_availability(self, GMS_objs, tgt_procL):
dss = self.PC.add_local_availability([GMS_object_2_dataset_dict(obj) for obj in GMS_objs]) dss = self.PC.add_local_availability([GMS_object_2_dataset_dict(obj) for obj in GMS_objs])
...@@ -208,9 +209,9 @@ class BaseTestCases: ...@@ -208,9 +209,9 @@ class BaseTestCases:
cls.PC.config.CPUs_all_jobs = 3 cls.PC.config.CPUs_all_jobs = 3
cls.PC.config.max_parallel_reads_writes = 3 cls.PC.config.max_parallel_reads_writes = 3
# cls.PC.config.spathomo_estimate_accuracy = True cls.PC.config.spathomo_estimate_accuracy = True
# cls.PC.config.ac_estimate_accuracy = True # FIXME cls.PC.config.ac_estimate_accuracy = True
# cls.PC.config.spechomo_estimate_accuracy = True # FIXME cls.PC.config.spechomo_estimate_accuracy = True
# cls.PC.config.exec_L1CP = [1, 1, 0] # cls.PC.config.exec_L1CP = [1, 1, 0]
# cls.PC.config.exec_2ACP = [1, 1, 0] # cls.PC.config.exec_2ACP = [1, 1, 0]
...@@ -237,6 +238,18 @@ class Test_Landsat5_PreCollectionData(BaseTestCases.TestAll): ...@@ -237,6 +238,18 @@ class Test_Landsat5_PreCollectionData(BaseTestCases.TestAll):
def setUpClass(cls): def setUpClass(cls):
cls.create_job(26186263, job_config_kwargs) cls.create_job(26186263, job_config_kwargs)
class Test_Landsat5_PreCollectionData_CompletePipeline(BaseTestCases.TestCompletePipeline):
"""
Parametrized testclass. Tests the level-processes on a Landsat-5 TM scene (pre-collection data).
More information on the dataset will be output after the tests-classes are executed.
"""
@classmethod
def setUpClass(cls):
cls.create_job(26186263, job_config_kwargs)
# class Test_Landsat5_CollectionData(BaseTestCases.TestAll): # class Test_Landsat5_CollectionData(BaseTestCases.TestAll):
# """ # """
# Parametrized testclass. Tests the level-processes on a Landsat-5 TM scene (collection data). # Parametrized testclass. Tests the level-processes on a Landsat-5 TM scene (collection data).
......
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