EOX GitLab Instance

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

Revert "f"

This reverts commit 3e03f086.
parent 3e03f086
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 = True
force_refresh = False
# make processing steps
for step in ['custom_preprocessor', 'subdatasets', 'georeference', 'calc', 'stack_bands', 'output', 'custom_postprocessor']:
step_config = preprocess_config.get(step)
......
......@@ -12,8 +12,7 @@ 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(iter(glob(join(source_dir, item['inputs']['A']['glob']))), None)
filename = next(glob(join(source_dir, item['inputs']['glob'])))
target_filename = join(
target_dir,
replace_ext(basename(filename), item.get('output_postfix', '_proc%d' % i) + '.tif', False)
......@@ -37,12 +36,13 @@ def calc_formula(source_dir: os.PathLike, inputs: List[dict], target_filename: o
"--outfile=%s" % target_filename,
"--type", data_type,
]
for name in inputs:
# select first
filename = next(iter(glob(join(source_dir, inputs[name]['glob']))), None)
for name, locator in inputs:
# select first
filename = next(glob(join(source_dir, locator['glob'])))
cmd.extend([
"-%s" % name, filename,
"--%s_band=%d" % (name, inputs[name].get('band', 1)),
"-%s_band=%d" % locator.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