regionmask.Regions_cls¶
-
class
regionmask.Regions_cls(name, numbers, names, abbrevs, outlines, centroids=None, source='')¶ class for plotting regions and creating region masks
Attributes
numberslist of the numbers of the regions nameslist of long names abbrevslist of abbreviations centroidslist of the center of mass of the regions name (string) Name of the collection of regions. outlines (List of Nx2 float array of vertices, Polygon, MultiPolygon) List of coordinates/ outline of the region as shapely Polygon/ MultiPolygon or list. Must be accessible as outlines[number]. -
__init__(name, numbers, names, abbrevs, outlines, centroids=None, source='')¶ Parameters: name : string
Name of the collection of regions.
numbers : list of int
List of numerical indces for every region.
names : dict of string
Long name of each region. Must be accessible as names[number].
abbrevs : dict of string
List of abbreviations of each region. Must be accessible as abbrevs[number].
outlines : List of Nx2 float array of vertices, Polygon, MultiPolygon
List of coordinates/ outline of the region as shapely Polygon/ MultiPolygon or list. Must be accessible as outlines[number].
centroids : list of 1x2 iterable, optional.
Center of mass of this region. If not provided is calculated as (Multi)Polygon.centroid
source : string, optional
Source of the region definitions. Default: ‘’.
Methods
__init__(name, numbers, names, abbrevs, outlines)Parameters: combiner(prop)map_keys(key)map from names and abbrevs of the regions to numbers mask(lon_or_obj[, lat, lon_name, lat_name, ...])create a grid as mask of a set of regions for given lat/ lon grid plot([ax, proj, regions, add_label, label, ...])plot map with with srex regions Attributes
abbrevslist of abbreviations centroidslist of the center of mass of the regions coordslist of coordinates of the region vertices as numpy array nameslist of long names numberslist of the numbers of the regions polygonslist of shapely Polygon/ MultiPolygon of the regions region_idsdict mapping all names and abbrevs to the region number -