Determine which geographic region each grid point belongs to.
When working with gridded data such as climate model output or reanalysis data it is often important to create regional averages, e.g., over countries, continents or regions defined in the literature. To do so we need to know for each grid point to which region it belongs to.
regionmask is a python package that:
- can be used to create masks of (geo)spatial regions for arbitrary (longitude and latitude) grids. These masks indicate which region a gridpoint belongs to and can then be used to aggregate gridded data over the regions. The masks come in three variants:
2D integer masks<notebooks/mask_2D>
3D boolean masks<notebooks/mask_3D>
3D approximate fractional mask<notebooks/mask_3D_frac_approx>
- takes great care to create consistent masks for
region edges and interiors<notebooks/method>
overlapping regions<notebooks/overlap>
- contains a number of defined regions, including:
countries</defined_countries>
landmasks</defined_landmask>
regions used in the scientific literature</defined_scientific>
- can
plot figures of these regions<notebooks/plotting>
- supports using arbitrary existing or user-defined region definitions:
- regions defined as shapefiles can be
accessed via geopandas<notebooks/geopandas>
user-defined regions<notebooks/create_own_regions>
can be created via numpy or shapely
- regions defined as shapefiles can be
installation
notebooks/plotting notebooks/mask_2D notebooks/mask_3D notebooks/mask_3D_frac_approx notebooks/detect_coords notebooks/geopandas notebooks/create_own_regions notebooks/overlap intake_regionmask
defined_countries defined_landmask defined_ocean_basins defined_scientific
notebooks/method notebooks/method_mask_3D_frac_approx
changelog api
regionmask is published under a MIT license.
genindex
search