Skip to content

Commit fd2232a

Browse files
committed
fill land/nans with 0s
1 parent a468ade commit fd2232a

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/virtualship/instruments/base.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,10 @@ def _generate_fieldset(self) -> parcels.FieldSet:
222222

223223
# negate depth and reindex (to suit Parcels XGrid strictly increasing depth convention)
224224
ds["depth"] = -ds["depth"]
225-
ds = ds.reindex(depth=ds["depth"][::-1]) #
225+
ds = ds.reindex(depth=ds["depth"][::-1])
226+
227+
# TODO: update when decision on handling of nans/0s in v4 is made (i.e. https://github.com/Parcels-code/Parcels/issues/2393)
228+
ds = ds.fillna(0)
226229

227230
fields = {key: ds[field_var_name]}
228231
ds_fset = parcels.convert.copernicusmarine_to_sgrid(fields=fields)

0 commit comments

Comments
 (0)