pysteps.visualization.utils.get_geogrid
pysteps.visualization.utils.get_geogrid¶
- pysteps.visualization.utils.get_geogrid(nlat, nlon, geodata=None)¶
Get the geogrid data. If geodata is None, a regular grid is returned. In this case, it is assumed that the origin of the 2D input data is the upper left corner (“upper”).
- Parameters
- nlat: int
Number of grid points along the latitude axis
- nlon: int
Number of grid points along the longitude axis
- geodata:
geodata: dictionary or None Optional dictionary containing geographical information about the field.
If geodata is not None, it must contain the following key-value pairs:
Key
Value
projection
PROJ.4-compatible projection definition
x1
x-coordinate of the lower-left corner of the data raster
y1
y-coordinate of the lower-left corner of the data raster
x2
x-coordinate of the upper-right corner of the data raster
y2
y-coordinate of the upper-right corner of the data raster
yorigin
a string specifying the location of the first element in the data raster w.r.t. y-axis: ‘upper’ = upper border, ‘lower’ = lower border
- Returns
- x_grid: 2D array
X grid with dimensions of (nlat, nlon) with the same y-origin as the one specified in the geodata (or “upper” if geodata is None).
- y_grid: 2D array
Y grid with dimensions of (nlat, nlon) with the same y-origin as the one specified in the geodata (or “upper” if geodata is None).
- extent: tuple
Four-element tuple specifying the extent of the domain according to (lower left x, upper right x, lower left y, upper right y).
- regular_grid: bool
True is the grid is regular. False otherwise.
- origin: str
Place the [0, 0] index of the array to plot in the upper left or lower left corner of the axes.