Skip to content
Snippets Groups Projects
Commit 7bee0903 authored by Valentin Simon Lüdke's avatar Valentin Simon Lüdke
Browse files

Add some logging to data_var determination

parent e6862096
No related branches found
No related tags found
2 merge requests!16Generate classical mhm setups from classical setup,!8Draft: Resolve "Pre-Proc: incorporate tools for creating global setups"
Pipeline #274465 failed with stages
in 2 minutes and 24 seconds
......@@ -53,8 +53,10 @@ def get_single_data_var(ds):
return data_vars[0]
def induce_data_var_from_file_name(ds, file_path):
logger.info('Searching for more than one datavar by comparing with file name.')
name = file_path.stem
data_vars = list(ds.data_vars)
logger.debug(f'{name} - {data_vars}')
for dv in data_vars:
if dv in name:
return dv
......
......@@ -90,6 +90,7 @@ def crop_file_with_header(ds_in, file_path, mask, output_path):
if data_var is None:
logger.error(f'File {file_path} could not be croped because the data_var could not be determined.')
return None, None
logger.debug(f'Found data_var={data_var}')
with header.open("r") as h:
d = {}
logger.debug(f"Reading out header.txt file {header}")
......
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