EOX GitLab Instance

Skip to content
Snippets Groups Projects
Commit 3e03f086 authored by Lubomir Dolezal's avatar Lubomir Dolezal
Browse files

f

parent d560b3e2
No related branches found
No related tags found
No related merge requests found
......@@ -183,7 +183,7 @@ def preprocess_file(config: dict, file_path: os.PathLike, use_dir: os.PathLike=N
previous_step = 'unpack'
force_refresh = False
force_refresh = True
# make processing steps
for step in ['custom_preprocessor', 'subdatasets', 'georeference', 'calc', 'stack_bands', 'output', 'custom_postprocessor']:
step_config = preprocess_config.get(step)
......
......@@ -12,7 +12,8 @@ from ..util import replace_ext
def calc_step(source_dir: os.PathLike, target_dir: os.PathLike, formulas: List[dict]):
for i, item in enumerate(formulas):
# get first filename as a base
filename = next(glob(join(source_dir, item['inputs']['glob'])))
filename = next(iter(glob(join(source_dir, item['inputs']['A']['glob']))), None)
target_filename = join(
target_dir,
replace_ext(basename(filename), item.get('output_postfix', '_proc%d' % i) + '.tif', False)
......@@ -36,13 +37,12 @@ def calc_formula(source_dir: os.PathLike, inputs: List[dict], target_filename: o
"--outfile=%s" % target_filename,
"--type", data_type,
]
for name, locator in inputs:
# select first
filename = next(glob(join(source_dir, locator['glob'])))
for name in inputs:
# select first
filename = next(iter(glob(join(source_dir, inputs[name]['glob']))), None)
cmd.extend([
"-%s" % name, filename,
"-%s_band=%d" % locator.get('band', 1),
"--%s_band=%d" % (name, inputs[name].get('band', 1)),
])
if nodata_value is not None:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment