Closed kthyng closed 2 months ago
It almost seems like we incorrectly convert Nan to float somewhere. Do you have a test simulation where this happens regularly?
OpenDrift has until now not masked NaN-values in output netCDF-file, as instead the status
variable had to be used manually for masking.
However, FillValue of NaN (or -999 for integers) are now applied: https://github.com/OpenDrift/opendrift/pull/1291/files
The Nan-values should correspond to elements deactivated, or not yet seeded. Otherwise status
shall be 0 for active particles, and a positive integer for deactivated elements (though the final properties at time of deactication are not repeated until the end of the netCDF-file, for historical and performance reasons)
Can you update and see if this solves your problem? If not, it would be great if you could make a minimalistic example to reproduce your problem.
@knutfrode I updated and yes your new changes fix my problem. Thank you!
small change to mask values in
get_lonlats(self)
for values of 9.969209968386869e+36I am not sure why these values occur but they happen when
coastline_action
is set to "stranding" andseafloor_action
to "deactivate" and then I can't plot the results. I couldn't find a way to avoid the values in the first place instead.I'm not sure is this is a universal problem or solution. What do you think @knutfrode?