Skip to content

Commit 1cb7841

Browse files
committed
Account for rounding error in valid cell masking
1 parent bc38f7c commit 1cb7841

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

landice/mesh_tools_li/interpolate_ecco_to_mali.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -302,10 +302,10 @@ def remap_ecco_to_mali(self):
302302
temp = ds_out['oceanTemperature']
303303
sal = ds_out['oceanSalinity']
304304

305-
mask = o3dm < 1.0
306-
ds_out['orig3dOceanMask'] = o3dm.where(~mask, 0).astype('int32')
307-
ds_out['oceanTemperature'] = temp.where(~mask, 1e36).astype('float64')
308-
ds_out['oceanSalinity'] = sal.where(~mask, 1e36).astype('float64')
305+
mask = o3dm > 0.9999 #Account for rounding error. Good cells are not exactly 1
306+
ds_out['orig3dOceanMask'] = o3dm.where(mask, 0).astype('int32')
307+
ds_out['oceanTemperature'] = temp.where(mask, 1e36).astype('float64')
308+
ds_out['oceanSalinity'] = sal.where(mask, 1e36).astype('float64')
309309

310310
# Save final output file if not adding mesh variables
311311
if self.options.includeMeshVars:

0 commit comments

Comments
 (0)