Commit b75554a8 authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

Recreated test dataset for Test_Landsat8_PreCollectionData. Replaced two...


Recreated test dataset for Test_Landsat8_PreCollectionData. Replaced two os.system calls with subcall_with_output.
Signed-off-by: Daniel Scheffler's avatarDaniel Scheffler <danschef@gfz-potsdam.de>
parent 5142e464
Pipeline #12623 failed with stage
in 51 seconds
......@@ -16,6 +16,8 @@ History
* Fixed DeprecationsWarnings.
* Replaced GMS_object._numba_array_merger() with GMS_object._merge_arrays which does not use numba (and is much faster).
* Removed numba dependency.
* Recreated test dataset for Test_Landsat8_PreCollectionData.
* Replaced two os.system calls with subcall_with_out.
0.18.3 (2020-04-06)
......
......@@ -672,6 +672,8 @@ class GEOPROCESSING(object):
self.inDs = stack_in_mem
else: # CFG.inmem_serialization is False
from ..misc.helper_functions import subcall_with_output
self.logger.info('Adding the following bands to Layerstack:')
[self.logger.info(os.path.basename(i)) for i in layers_pathlist]
......@@ -685,7 +687,12 @@ class GEOPROCESSING(object):
str_layers_pathlist = ' '.join(layers_pathlist)
if self.subset is None:
os.system("gdal_merge.py -q -o %s -of ENVI -seperate %s" % (path_output, str_layers_pathlist))
cmd = "gdal_merge.py -q -o %s -of ENVI -seperate %s" % (path_output, str_layers_pathlist)
output, exitcode, err = subcall_with_output(cmd)
if exitcode:
raise RuntimeError(err)
if output:
return output.decode('UTF-8')
# FIXME this changes the format of the projection (maybe a GDAL bug?)
# FIXME normalize by EPSG2WKT(WKT2EPSG(WKT))
else:
......@@ -698,8 +705,13 @@ class GEOPROCESSING(object):
LR_Ygeo = GT[3] + self.colEnd * GT[4] + self.rowEnd * GT[5]
ullr = '%s %s %s %s' % (UL_Xgeo, UL_Ygeo, LR_Xgeo, LR_Ygeo)
os.system(
"gdal_merge.py -q -o %s -ul_lr %s -of ENVI -seperate %s" % (path_output, ullr, str_layers_pathlist))
cmd = "gdal_merge.py -q -o %s -ul_lr %s -of ENVI -seperate %s" \
% (path_output, ullr, str_layers_pathlist)
output, exitcode, err = subcall_with_output(cmd)
if exitcode:
raise RuntimeError(err)
if output:
return output.decode('UTF-8')
if [GT, PR] == [(0.0, 1.0, 0.0, 0.0, 0.0, 1.0), '']:
# delete output map info in case of arbitrary coordinate system
......
......@@ -254,7 +254,7 @@ def L2B_map(L2A_obj):
@EXC_H.log_uncaught_exceptions
@update_proc_status
def L2C_map(L2B_obj):
# type: (L2B_P.L2B_object) -> L2C_P.L2C_objec
# type: (L2B_P.L2B_object) -> L2C_P.L2C_object
L2B_obj.block_at_system_overload(max_usage=CFG.critical_mem_usage)
L2C_obj = L2C_P.L2C_object(L2B_obj)
if CFG.exec_L2CP[1]:
......
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