Skip to content

Commit 80f047d

Browse files
committed
This should help the bin_average function runtime
1 parent 8e1fd08 commit 80f047d

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

mhkit/dolfyn/velocity.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -658,16 +658,17 @@ def bin_average(self, raw_ds, out_ds=None, names=None):
658658
).astype("float32")
659659
except: # variables not needing averaging
660660
pass
661-
# Add standard deviation
662-
std = self.standard_deviation(raw_ds.velds.U_mag.values)
663-
out_ds["U_std"] = xr.DataArray(
664-
std.astype("float32"),
665-
dims=raw_ds.vel.dims[1:],
666-
attrs={
667-
"units": "m s-1",
668-
"long_name": "Water Velocity Standard Deviation",
669-
},
670-
)
661+
662+
# Add standard deviation
663+
std = self.standard_deviation(raw_ds.velds.U_mag.values)
664+
out_ds["U_std"] = xr.DataArray(
665+
std.astype("float32"),
666+
dims=raw_ds.vel.dims[1:],
667+
attrs={
668+
"units": "m s-1",
669+
"long_name": "Water Velocity Standard Deviation",
670+
},
671+
)
671672

672673
return out_ds
673674

0 commit comments

Comments
 (0)