Skip to content

Commit b04e6eb

Browse files
committed
Ensure mask if a float if being applied
1 parent c27c0fe commit b04e6eb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/CSET/operators/filters.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ def apply_mask(
5656
"""
5757
masked_fields = iris.cube.CubeList([])
5858
for M, F in zip(iter_maybe(mask), iter_maybe(original_field), strict=True):
59-
# Ensure mask is only 1s or NaNs.
59+
# Ensure mask data are floats and only 1s or NaNs.
60+
M.data = np.float64(M.data)
6061
M.data[M.data == 0.0] = np.nan
6162
M.data[~np.isnan(M.data)] = 1.0
6263
logging.info(

0 commit comments

Comments
 (0)