We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 34f32e4 commit 9d928d9Copy full SHA for 9d928d9
pydomcfg/tests/bathymetry.py
@@ -163,7 +163,7 @@ def _calc_rmax(depth):
163
# |(H[0] - H[1])| / (H[0] + H[1])
164
# First value is NaN
165
diff = rolled.diff("tmp_dim").squeeze("tmp_dim")
166
- rmax = diff / rolled.sum("tmp_dim")
+ rmax = np.abs(diff) / rolled.sum("tmp_dim")
167
168
# (rmax[0] + rmax[1]) / 2
169
# First two values are NaN
@@ -172,6 +172,6 @@ def _calc_rmax(depth):
172
# First and last values are zero
173
rmax = rmax.shift({dim: -1}).fillna(0)
174
175
- both_rmax.append(np.abs(rmax))
+ both_rmax.append(rmax)
176
177
return np.maximum(*both_rmax)
0 commit comments