Commit 68cefc6f authored by Daniel Scheffler's avatar Daniel Scheffler Committed by Daniel Scheffler
Browse files

- added some code to GMS_system_setup

- L1B-P: added still non-working code for image shift calculation
parent 1e39d909
......@@ -1703,10 +1703,8 @@ class GEOPROCESSING(object):
# self.bandsList == range(self.bands) if subset != custom!
for x, out_idx in zip(self.bandsList, range(self.bands)):
band = self.inDs.GetRasterBand(x + 1) # Read inputband as numpyarray
if self.subset is None or self.subset[0] == 'cube':
data = band.ReadAsArray(0, 0, self.cols, self.rows).astype(np.int16)
else:
data = band.ReadAsArray(self.colStart, self.rowStart, self.cols, self.rows).astype(np.int16)
cS,rS = [0,0] if self.subset is None or self.subset[0] == 'cube' else [self.colStart, self.rowStart]
data = band.ReadAsArray(cS, rS, self.cols, self.rows).astype(np.int16)
# if self.bands > 1:
# img[:,:,out_idx] = data
mask_1bit[:, :, out_idx][data[:, :] != nodataVal] = 1
......@@ -1720,8 +1718,10 @@ class GEOPROCESSING(object):
return mask_1bit
def calc_FullDataset_corner_positions(self, mask_data_nodata=None):
'''Calculates the image coordinates of the true data corners for rotated datasets.
ONLY usable for entire images - no tiles!'''
'''
Calculates the image coordinates of the true data corners for rotated datasets.
ONLY usable for entire images - no tiles!
'''
if self.subset is not None: self.logger.critical(
'Unable to calculate trueDataCornerPos for a subset of an image. calc_FullDataset_corner_positions can \
only be called if GEOP object represents a full image.'); sys.exit()
......
......@@ -62,7 +62,8 @@ def get_entity_IDs_within_AOI(): # called in console mode
for ds in data_list:
ds['acquisition_date'] = datetime.datetime.strptime(ds['acquisition_date'], '%Y-%m-%d')
ds['subsystem'] = '' if ds['subsystem']==None else ds['subsystem']
ds['scene_ID'] = None
#ds['scene_ID'] = '_'.join([ds['satellite'],ds['sensor'],ds['subsystem'],ds['entity_ID']])
ds['scene_ID'] = ds['entity_ID']
ds['sensormode'] = get_sensormode(ds)
if usecase.skip_thermal:
data_list = [ds for ds in data_list if not ds['subsystem'] == 'TIR'] # removes ASTER TIR in case of skip_thermal
......@@ -186,8 +187,9 @@ def add_local_availability(dataset):
else:
dataset['GMS_proc_level'] = HighestProcL_dueLog
else:
print('Found a matching dataset for %s but with a different LayerBandsAssignment. \
Dataset has to be reprocessed.' %dataset['entity_ID'])
print('Found a matching dataset for %s but with a different LayerBandsAssignment. ' \
'Dataset has to be reprocessed.' %dataset['entity_ID'])
dataset['GMS_proc_level'] = None
else:
dataset['GMS_proc_level'] = None
else:
......
......@@ -18,7 +18,7 @@
########################### Library import ####################################
import numpy as np, os, spectral, spectral.io.envi as envi, re, sys, glob, subprocess, shutil, collections, \
gdal, gdalconst, gdalnumeric, zipfile, tarfile, builtins
gdal, gdalconst, gdalnumeric, zipfile, tarfile
from pyhdf import SD
from numba import jit, autojit
......@@ -46,6 +46,7 @@ class L1A_object(object):
'path_logfile', 'georef']:
if hasattr(L0B_object, n):
setattr(self, n, getattr(L0B_object, n))
self.outInterleave = 'bsq'
self.LayerBandsAssignment = ''
self.dict_LayerOptTherm = None
......
This diff is collapsed.
......@@ -121,7 +121,7 @@ class usecase:
# processor configuration: [run processor, write output]
exec__L0BP = [1]
exec__L1AP = [1, 1]
exec__L1BP = [0, 0]
exec__L1BP = [1, 0]
exec__L1CP = [1, 1]
exec__L1DP = [1, 1]
exec__L2AP = [0, 0]
......
......@@ -112,7 +112,7 @@ def reorder_ENVI_header(path_hdr):
for i in ['description', 'samples', 'lines', 'bands', 'header offset','file type','data type',
'interleave', 'sensor type','byte order', 'reflectance scale factor','map info',
'coordinate system string','corner coordinates lonlat','image_type','Satellite',
'Sensor','Subsystem','SceneID','arr_pos','arr_shape','Metafile','gResolution',
'Sensor','Subsystem','EntityID','arr_pos','arr_shape','Metafile','gResolution',
'AcqDate','AcqTime','wavelength','bandwidths','band names','LayerBandsAssignment',
'data gain values','data offset values','reflectance gain values','reflectance offset values',
'ThermalConstK1', 'ThermalConstK2','ProcLCode','PhysUnit','wavelength units','SunElevation','SunAzimuth',
......
......@@ -12,8 +12,10 @@ from __future__ import (division, print_function, unicode_literals,absolute_impo
from multiprocessing import dummy
import sys, os, shutil, logging, multiprocessing,datetime,time,numpy as np,pickle,glob, dill, builtins
builtins.GMS_call_type = 'console' if len(sys.argv) < 2 else 'webapp'
builtins.GMS_process_ID = datetime.datetime.now().strftime("%Y%m%d__%Hh%Mm%Ss") if len(sys.argv) < 2 else int(sys.argv[1])
called_from_iPyNb = lambda sys_argv: 'ipykernel/__main__.py' in sys.argv[0]
builtins.GMS_call_type = 'console' if len(sys.argv) < 2 or called_from_iPyNb else 'webapp'
builtins.GMS_process_ID = datetime.datetime.now().strftime("%Y%m%d__%Hh%Mm%Ss") if len(sys.argv) < 2\
or called_from_iPyNb else int(sys.argv[1])
import config
builtins.GMS_config = config
for i in [attr for attr in dir(config) if attr.startswith('exec__')]:
......
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