We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8a15145 commit f875e5fCopy full SHA for f875e5f
1 file changed
mhkit/river/io/d3d.py
@@ -224,6 +224,14 @@ def get_layer_data(
224
if isinstance(var[0][0], np.ma.core.MaskedArray):
225
max_layer = len(var[0][0])
226
227
+ if abs(layer_index) > max_layer:
228
+ raise ValueError(f"layer_index must be less than the max layer {max_layer}")
229
+
230
+ v = np.ma.getdata(var[time_index, :, layer_index], False)
231
+ dimensions = 3
232
+ elif isinstance(var[0][0], xr.core.variable.Variable):
233
+ max_layer = var[0][0].shape[0]
234
235
if abs(layer_index) > max_layer:
236
raise ValueError(f"layer_index must be less than the max layer {max_layer}")
237
0 commit comments