OpenDrift / opendrift

Open source framework for ocean trajectory modelling
https://opendrift.github.io
GNU General Public License v2.0
246 stars 120 forks source link

Meaning of NaN #604

Closed AndresSepulveda closed 3 years ago

AndresSepulveda commented 3 years ago

Quick question, what are reasons for asigning NaNs to a particle?

11:13:30 DEBUG opendrift: NaN values for 1175 elements, expanding data 2 11:13:30 DEBUG opendrift: NaN values for 157 elements, expanding data 3 11:13:30 DEBUG opendrift: NaN values for 2290 elements, expanding data 1 11:13:30 DEBUG opendrift: NaN values for 1175 elements, expanding data 2 11:13:30 DEBUG opendrift: NaN values for 157 elements, expanding data 3

knutfrode commented 3 years ago

This is from the extrapolation of ocean model towards the coastline. The data from ocean model has NaN where the ocean model has land, but this is extrapolated with binary dilution, step-by-step, to fill inn the gap between the wet pixels of the ocean model, and the independent GSHHG landmask.

So here 2290 elements are "trapped" between ocean model wet pixels and GSHHG landmask, and the ocean model grid is extrapolated by 1 pixel. Then 1175 elements are still not covered, and another pixel is extrapolated, and so on until all elements are covered with data.

So you would not see this if you were using instead raster landmask from the same ocean model.

AndresSepulveda commented 3 years ago

Thanks Knut,

In the case of the ROMS model, I if I have a land_binary_mask in the same file as the currents, what do I have to specify?

knutfrode commented 3 years ago

Then you have to deactivate the default GSHHG landmask by

o.set_config('general:use_auto_landmask', False)

like in this example: https://opendrift.github.io/gallery/example_model_landmask.html