OpenDrift / opendrift

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

Custom binary landmask combining with inbuilt landmask #1239

Closed rhysomac closed 4 months ago

rhysomac commented 4 months ago

Hi, I'm trying to run an OceanDrift model using my own land_binary_mask. I've checked to make sure it's all zeros and ones, it's the same x and y dimensions as my sea water velocity and wind variables and it appears to be successfully recognised by the model:

=========================== Reader: calib_subset_OD.nc ... Variables: land_binary_mask x_sea_water_velocity y_sea_water_velocity eastward_wind northward_wind x_wind y_wind

I also have the line "mod.set_config('general:use_auto_landmask', False)" to ensure it uses my landmask. Despite this, when I run reader.plot('land_binary_mask') I see a combination of my landmask (0 and 1) and what looks like NaNs from what I assume are the inbuilt landmask (see image). When I run the model I get the error:

INFO opendrift.models.basemodel:1363: Problems setting mask on missingindices! ERROR opendrift.models.basemodel:1365: object of type 'numpy.bool' has no len() Traceback (most recent call last): File "C:\Users\r.mcintosh\opendrift\opendrift\models\basemodel.py", line 1358, in get_environment if len(missing_indices) != len(combinedmask): ^^^^^^^^^^^^^^^^^^ TypeError: object of type 'numpy.bool' has no len()

Can anyone help me to understand why I'm getting this apparent combined landmask situation? I've attached the full log as well.

OD_landmask_output

OD_log.txt