Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

natural_earth: countries_50 & land_50 not extending to -90° N #487

Closed
mathause opened this issue Oct 29, 2023 · 0 comments · Fixed by #488
Closed

natural_earth: countries_50 & land_50 not extending to -90° N #487

mathause opened this issue Oct 29, 2023 · 0 comments · Fixed by #488

Comments

@mathause
Copy link
Member

Similarly to #410, natural_earth_v4_1_0.countries_50 and natural_earth_v4_1_0.land_50 (as well as natural_earth_v5_0_0....) don't extend all the way to -90°N, which leads to the southernmost gridcell not being masked. The following don't reach -90°N:

import regionmask

print(regionmask.defined_regions.natural_earth_v4_1_0.countries_50.bounds_global[1])
print(regionmask.defined_regions.natural_earth_v5_0_0.countries_50.bounds_global[1])
print(regionmask.defined_regions.natural_earth_v4_1_0.land_50.bounds_global[1])
print(regionmask.defined_regions.natural_earth_v5_0_0.land_50.bounds_global[1])

# -89.99892578
# -89.99892578
# -89.99892578
# -89.99892578

Resulting in incomplete masks (it only looks so extreme because the grid spacing is 5° - it's just the southernmost gridpoint that does not work):

import regionmask
import matplotlib.pyplot as plt
import numpy as np
import cartopy.crs as ccrs

lon = np.arange(-180, 180, 5)
lat = np.arange(90, -91, -5)


mask = regionmask.defined_regions.natural_earth_v4_1_0.land_50.mask(lon, lat)


ax = regionmask.defined_regions.natural_earth_v4_1_0.land_50.plot(add_coastlines=False, add_label=False, projection=ccrs.Orthographic(central_latitude=-90))
mask.plot(ax=ax, add_colorbar=False, transform=ccrs.PlateCarree())

ax.set_extent([-180, 180, -90, -45], ccrs.PlateCarree())

plt.savefig("land_50_not_southpole.png", dpi=300, bbox_inches="tight")

land_50_not_southpole

Note that e.g. land_110 does not have this problem:

import regionmask
print(regionmask.defined_regions.natural_earth_v5_0_0.land_110.bounds_global[1])
# -90.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant