CartesianGrid2D(polygons, dh, name='cartesian2d')¶
Represents a 2D cartesian gridded region.
The class provides functions to query onto an index 2D Cartesian grid and maintains a mapping between space coordinates defined by polygons and the index into the polygon array.
Custom regions can be easily created by using the from_polygon classmethod. This function will accept an arbitrary closed polygon and return a CartesianGrid class with only points inside the polygon to be valid.
__init__(polygons, dh, name='cartesian2d')¶
Initialize self. See help(type(self)) for accurate signature.
__init__(polygons, dh[, name])
from_origins(origins[, dh, magnitudes, name])
Creates instance of class from 2d numpy.array of lon/lat origins.
Returns rectangular bounding box around region.
Returns 2d ndrray representation of the data set, corresponding to the bounding box.
Returns the index of lons, lats in self.polygons
Returns the polygon associated with the index idx.
Returns bool array lons and lats are not included in the spatial region.
Returns midpoints of rectangular polygons in region
Returns origins of rectangular polygons in region
Number of polygons in region