Skip to content
Snippets Groups Projects
Commit c179dea7 authored by Nils Brüggemann's avatar Nils Brüggemann
Browse files

tools/pyic_fig.py: Rename dimensions to fit 'ncells', 'depth' naming convention.

parent 9e963fc6
No related branches found
No related tags found
No related merge requests found
......@@ -222,9 +222,16 @@ mfdset_kwargs = dict(combine='nested', concat_dim='time',
data_vars='minimal', coords='minimal',
compat='override', join='override',)
ds = xr.open_mfdataset(fpath_data, **mfdset_kwargs)
data = ds[var]
# --- rename dimensions
if 'cells' in data.dims:
data = data.rename(cells='ncells')
for dim in data.dims:
if dim.startswith('layers'):
data = data.rename({dim: 'depth'})
# --- reduce time and depth dimension
data = ds[var]
if 'depth' in data.dims:
depth_name = 'depth'
elif 'depth_2' in data.dims:
......
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