Commit 1cba1aa5 authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

Revised SRF_DB_2_PKL

Former-commit-id: 05b69e34
Former-commit-id: c2dd2bb6
parent ce68c332
......@@ -15,26 +15,24 @@ from geomultisens.misc.logging import GMS_logger
from geomultisens import __file__
def dump_all_SRFs(outpath_dump=os.path.abspath(os.path.join(os.path.dirname(__file__), '../sandbox/out/SRF_DB.pkl')),
outpath_log=os.path.abspath(os.path.join(os.path.dirname(__file__), '../sandbox/out/SRF_DB.log'))):
out_dict = {}
logger = GMS_logger('log__SRF_DB', path_logfile=outpath_log, append=True)
for sensorcode,out_sensorcode in zip(['AST_V1','AST_V2','AST_S','AST_T','TM5','TM7','LDCM','RE5','S1','S4','S5'],
['ASTER_VNIR1','ASTER_VNIR2','ASTER_SWIR','ASTER_TIR','LANDSAT_TM5','LANDSAT_TM7','LANDSAT_LDCM',
'RapidEye_5','Spot_1','Spot_4','Spot_5']):
out_dict[out_sensorcode] = INP_R.SRF_reader(sensorcode,logger)
out_dict = {}
logger = GMS_logger('log__SRF_DB',
path_logfile=os.path.abspath(os.path.join(os.path.dirname(__file__), '../sandbox/out/SRF_DB.log')),
append=True)
for sensorcode,out_sensorcode in zip(['AST_V1','AST_V2','AST_S','AST_T','TM5','TM7','LDCM','RE5','S1','S4','S5'],
['ASTER_VNIR1','ASTER_VNIR2','ASTER_SWIR','ASTER_TIR','LANDSAT_TM5','LANDSAT_TM7','LANDSAT_LDCM',
'RapidEye_5','Spot_1','Spot_4','Spot_5']):
out_dict[out_sensorcode] = INP_R.SRF_reader(sensorcode,logger)
with open(outpath_dump, 'wb') as outFile:
pickle.dump(out_dict, outFile)
outFilename = '//misc/hy5/scheffler/Skripte_Models/python/GeoMultiSens/sandbox/out/SRF_DB.pkl'
with open(outFilename, 'wb') as outFile:
pickle.dump(out_dict, outFile)
print ('Saved SRF dictionary to %s' %outpath_dump)
print ('Saved SRF dictionary to %s' %outFilename)
with open(outpath_dump, 'rb') as inFile:
readFile = pickle.load(inFile)
with open(outFilename, 'rb') as inFile:
readFile = pickle.load(inFile)
print(readFile == out_dict)
print(readFile == out_dict)
for i in readFile.items():
print(i)
for i in readFile.items():
print(i)
......@@ -660,6 +660,7 @@ class GMS_object(Dataset):
@staticmethod
@jit
def _numba_array_merger(list_GMS_tiles, arrname2merge, target_shape, target_dtype):
# type: (list, str, tuple, np.dtype) -> np.ndarray
"""
private function, e.g. called by merge_GMS_tiles_to_GMS_obj() in order to fasten array merging
......
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