Commit 8a024168 authored by Jan Klaus Rieck's avatar Jan Klaus Rieck

better conditions for defining over with depth dimension to average/sum

parent b9d0d323
Pipeline #3646 failed with stage
in 1 minute and 26 seconds
......@@ -487,12 +487,15 @@ def depthave(ds, std_count=False):
+ ' vertical average!')
for gr in grids:
grid = grids[gr]
if ('z_c' in ds.dims) or ('z_l' in ds.dims):
argu = {'dim': grid['z'], 'skipna': True, 'keep_attrs': True}
arg_count = {'dim': grid['z'], 'keep_attrs': True}
elif ('z_c' in ds.dims) and ('z_l' in ds.dims):
if ('z_c' in ds.dims) and ('z_l' in ds.dims):
argu = {'dim': ('z_c', 'z_l'), 'skipna': True, 'keep_attrs': True}
arg_count = {'dim': ('z_c', 'z_l'), 'keep_attrs': True}
elif ('z_c' in ds.dims) and ('z_l' not in ds.dims):
argu = {'dim': grid['z'], 'skipna': True, 'keep_attrs': True}
arg_count = {'dim': grid['z'], 'keep_attrs': True}
elif ('z_l' in ds.dims) and ('z_c' not in ds.dims):
argu = {'dim': grid['z'], 'skipna': True, 'keep_attrs': True}
arg_count = {'dim': grid['z'], 'keep_attrs': True}
else:
raise ValueError('no depth dimension!'
+ ' (looking for `z_c` and/or `z_l`)')
......@@ -943,12 +946,15 @@ def depthsum(ds, std_count=False):
+ ' vertical average!')
for gr in grids:
grid = grids[gr]
if ('z_c' in ds.dims) or ('z_l' in ds.dims):
argu = {'dim': grid['z'], 'skipna': True, 'keep_attrs': True}
arg_count = {'dim': grid['z'], 'keep_attrs': True}
elif ('z_c' in ds.dims) and ('z_l' in ds.dims):
if ('z_c' in ds.dims) and ('z_l' in ds.dims):
argu = {'dim': ('z_c', 'z_l'), 'skipna': True, 'keep_attrs': True}
arg_count = {'dim': ('z_c', 'z_l'), 'keep_attrs': True}
elif ('z_c' in ds.dims) and ('z_l' not in ds.dims):
argu = {'dim': grid['z'], 'skipna': True, 'keep_attrs': True}
arg_count = {'dim': grid['z'], 'keep_attrs': True}
elif ('z_l' in ds.dims) and ('z_c' not in ds.dims):
argu = {'dim': grid['z'], 'skipna': True, 'keep_attrs': True}
arg_count = {'dim': grid['z'], 'keep_attrs': True}
else:
raise ValueError('no depth dimension!'
+ ' (looking for `z_c` and/or `z_l`)')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment