Commit 0f875683 authored by sloosvel's avatar sloosvel Committed by Javier Vegas-Regidor
Browse files

Use masked array routines

parent 13486697
......@@ -216,6 +216,20 @@ class RegionMean(Diagnostic):
)
e3 = e3.extract(depth_constraint)
data = data.extract(depth_constraint)
if self.box.min_depth is -1 and self.box.max_depth is not -1:
self.box.min_depth = 0
depth_constraint = iris.Constraint(
depth=lambda c: self.box.min_depth <= c <= self.box.max_depth
)
e3 = e3.extract(depth_constraint)
data = data.extract(depth_constraint)
if self.box.min_depth is not -1 and self.box.max_depth is -1:
self.box.max_depth = 6000
depth_constraint = iris.Constraint(
depth=lambda c: self.box.min_depth <= c <= self.box.max_depth
)
e3 = e3.extract(depth_constraint)
data = data.extract(depth_constraint)
volcello = areacello * e3.data.astype(np.float32)
mean = regmean.compute_regmean_3d(data.data, masks, volcello)
self._save_result_2d("mean", mean, data)
......
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