Skip to content
Snippets Groups Projects
Commit ccbba807 authored by Aaron Spring's avatar Aaron Spring
Browse files

add logging cdo_post

parent 2e51b667
No related branches found
No related tags found
No related merge requests found
......@@ -45,7 +45,7 @@ def find_all_outdatatypes_in_exp(expid=expid, exppath=exppath, year=1990):
outdatatype = outdatatype.strip(f'{year}0101_{year}1231')
if outdatatype == 'co':
outdatatype = 'co2'
logging.DEBUG(
logging.debug(
f'Found file: model={model} outdatatype={outdatatype} '
f'ending={ending}'
)
......@@ -61,7 +61,7 @@ def read_all_outdatatype_files_to_ds(
ds_list = []
for outdatatype_id in outdatatypes:
try:
logging.INFO(f'Read {outdatatype_id} to xr.Dataset.')
logging.info(f'Read {outdatatype_id} to xr.Dataset.')
parts = outdatatype_id.split('_')
model = parts[0]
outdatatype = '_'.join(parts[1:])
......@@ -101,7 +101,7 @@ def read_all_outdatatype_files_to_ds(
ds[v].attrs['dims'] = list(ds[v].dims)
ds_list.append(ds.isel(time=0).mean())
except Exception as e:
logging.ERROR(f'{outdatatype_id} failed: {e}')
print(f'{outdatatype_id} failed: {e}')
return xr.merge(ds_list, compat='override')
......@@ -136,7 +136,7 @@ def generate_output_df(
# standard path
path = outpath + 'MPI-ESM-1-2-LR_output.csv'
if not recalc and os.path.exists(path):
logging.DEBUG(f'Read df from path: {path}')
logging.debug(f'Read df from path: {path}')
output_df = (
pd.read_csv(path, index_col='varname')
.rename(columns={'Unnamed: 0': 'varname'})
......@@ -194,7 +194,7 @@ def load_var_cdo(
)
def load_cdo(var, path, options, sel=sel):
logging.DEBUG(f'cdo {options} -select,name={var}{sel} {path}')
logging.debug(f'cdo {options} -select,name={var}{sel} {path}')
return cdo.select(
f'name={var}{sel}',
input=path,
......
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