xMIP icon indicating copy to clipboard operation
xMIP copied to clipboard

North Atlantic mask misses some ocean area between Greenland and Iceland

Open hmkhatri opened this issue 2 years ago • 8 comments

I followed the approach from tutorial notebook and created a mask for North Atlantic. However, there is a small region (see while space between Greenland and Iceland in figure) that has nan values, even though there is an ocean in between. I have tried creating masks with 1 deg and 0.25 deg. Both had this issue.

image

hmkhatri avatar Feb 24 '22 14:02 hmkhatri

Thanks for raising the issue @hmkhatri. The masking is ultimately based on combining smaller named subregions from regionmask. I suspect that a new one of these regions has been added during a recent update

@mathause, is this possible (also sorry for not responding on that old issue)?

@hmkhatri, could you follow the docs like this:

basins = regionmask.defined_regions.natural_earth.ocean_basins_50
basins.plot(add_ocean=False, add_label=True)

and zoom in on this region? I would be very curious to see what is going on, but do not currently have time to dig into this myself.

jbusecke avatar Feb 24 '22 15:02 jbusecke

Indeed, there is a a bit of ocean not part of any region - but it's the same with both versions of the naturalearthdata. v4.1 is orange and v5.0 is blue.

ocean_basins_50

@jbusecke you'll be able to specify the naturalearthdata version once the new version is released.

The code requires regionmask master or the upcoming 0.9 release.


%matplotlib

import cartopy.crs as ccrs
import regionmask

line_kws = dict(color="#ff7f00", lw=2)
ax= regionmask.defined_regions.natural_earth_v4_1_0.ocean_basins_50.plot(resolution="50m", line_kws=line_kws)

line_kws = dict(color="#1f78b4", lw=2, ls=":")
ax = regionmask.defined_regions.natural_earth_v5_0_0.ocean_basins_50.plot(resolution="50m", line_kws=line_kws)
ax.set_extent([-40, -10, 60, 90], ccrs.PlateCarree())

mathause avatar Feb 24 '22 19:02 mathause

@mathause @jbusecke Thanks for looking into this. Seems like some manual tweaking is needed to incorporate the missing region in the North Atlantic mask.

It is not a major issue and I managed to get rid of white space by combining North Atlantic mask and ocean wet point mask. It would be nice to update the code for correcting it. I am busy for next few weeks, but I would be happy to work on this later.

hmkhatri avatar Feb 25 '22 10:02 hmkhatri

Bummer to see that this is in fact baked into both NE versions. I have been thinking about refactoring the basin masking ability (#119) and maybe this should be part of it. Using the wetmask is not ideal IMO, since this method should really just rely on the lon/lat values of the model (which makes it quite universal). All that cmip6_pp does is just combine a bunch of shapefiles, so its concievable that we just add a manual correction there?

Then again, since I wrote this, I have actually used this in many more use cases outside of cmip6. I wonder if such a refactor should maybe include efforts upstream, to just publish a NE shapefile with ocean basins? This seems of much broader use than just for the cmip community. @mathause have you interacted with that community at all?

jbusecke avatar Mar 17 '22 00:03 jbusecke

@mathause have you interacted with that community at all?

No I didn't so far, but you have ;-) nvkelso/natural-earth-vector#319

mathause avatar Mar 17 '22 10:03 mathause

I pinged them over in https://github.com/nvkelso/natural-earth-vector/issues/697. Lets see what they think.

jbusecke avatar Mar 17 '22 18:03 jbusecke

On a separate note: It might be worth raising this issue over at their issue tracker again. They were very responsive to my suggestions! @hmkhatri

jbusecke avatar Mar 17 '22 18:03 jbusecke

Upstream support for this will be in Natural Earth v5.2.0 which is in public preview on Github.

nvkelso avatar Jun 02 '22 07:06 nvkelso