Marine Areas/ Ocean Basins (NaturalEarth)
The outline of the marine areas are obtained from Natural Earth. They are automatically downloaded, cached[1] and opened with geopandas. The following marine regions are defined in regionmask:
Ocean basins 1:50m
Import regionmask:
In [1]: import regionmask
Ocean Basins
Warning
natural_earth_v4_1_0.ocean_basins_50
and natural_earth_v5_0_0.ocean_basins_50
do not extend all the way to 180°E (see #410).
Please use natural_earth_v5_1_2.ocean_basins_50
Be careful, however, as the regions changed between the natural_earth versions.
In [2]: basins = regionmask.defined_regions.natural_earth_v5_1_2.ocean_basins_50
In [3]: basins
Out[3]:
<regionmask.Regions 'Natural Earth: ocean basins 50m'>
Source: http://www.naturalearthdata.com
overlap: False
Regions:
0 Arctic Ocean Arctic Ocean
1 SOUTHERN OCEAN SOUTHERN OCEAN
2 North Atlantic Ocean North Atlantic Ocean
3 North Pacific Ocean North Pacific Ocean
4 South Pacific Ocean South Pacific Ocean
.. ... ...
112 Ungava Bay Ungava Bay
113 Amazon River Amazon River
114 Yangtze River Yangtze River
115 Columbia River Columbia River
116 Korea Strait Korea Strait
[117 regions]
In [4]: basins.plot(add_label=False);
Also create a mask for a 1° grid globally:
In [5]: import numpy as np
# create a grid
In [6]: lon = np.arange(0.5, 360)
In [7]: lat = np.arange(89.5, -90, -1)
In [8]: mask = basins.mask(lon, lat)
In [9]: basins.plot(add_label=False);
In [10]: mask.plot(add_colorbar=False);