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

Missing islands when using raster landmask #1297

Open knutfrode opened 1 month ago

knutfrode commented 1 month ago

The following codelines illustrate that the Island of Sula (among others) is missing on the raster plot (fast=True), but present when plotting the full GSHHG vector coastline.

from datetime import datetime, timedelta
from opendrift.models.oceandrift import OceanDrift
o = OceanDrift()
o.seed_elements(lon=6.17, lat=62.36, time=datetime.now(), number=100, radius=1000)
o.run(steps=1)
o.plot(fast=True, filename='landmask_sula_raster.png')
o.plot(fast=False, filename='landmask_sula_GSHHG.png')

landmask_sula_raster landmask_sula_GSHHG

I am not sure what is the reason for this, but probably related to the area_thresh parameter that was available for Basemap: https://github.com/matplotlib/basemap/issues/158 Thus perhaps some similar threshold parameters could have been used when creating the global roaring landmask.

gauteh commented 1 month ago

I suspect that maybe roaring-landmask was made with an old GSSHG?

knutfrode commented 1 month ago

I am not sure whether some islands were actually missing in older version of GSHHG (called then GSHHS), or if it was just some islands that did not show on plots (and maybe in the rasterization) unless some criteria parameter (like area_thresh) was set low enough (e.g. 0).

gauteh commented 1 month ago

Ok. The mask is generated directly from the Shape-files, there is no parameters when opening them. I have to check.

gauteh commented 1 month ago

Looks like it is missing in the shape-files used for roaring-landmask, could be an error in the generation of those..

gauteh commented 1 month ago

Trying to fix this in roaring-landmask.