arlmet.Grid#
- class arlmet.Grid(projection, nx, ny)[source]#
Two-dimensional horizontal grid definition for ARL data.
- Parameters:
projection (Projection) – Grid projection metadata.
nx (int) – Number of grid points in the x-direction (columns).
ny (int) – Number of grid points in the y-direction (rows).
- crs#
Coordinate reference system for the grid.
- Type:
pyproj.CRS
- origin#
Origin (lower-left corner) in the base CRS (projected coordinates).
- calculate_coords() dict[str, Any][source]#
Calculate grid coordinates in both projected and geographic systems.
Examples
>>> from arlmet.grid import Grid, Projection >>> proj = Projection( ... pole_lat=90.0, ... pole_lon=180.0, ... tangent_lat=1.0, ... tangent_lon=1.0, ... grid_size=0.0, ... orientation=0.0, ... cone_angle=0.0, ... sync_x=1.0, ... sync_y=1.0, ... sync_lat=40.0, ... sync_lon=-120.0, ... ) >>> grid = Grid(projection=proj, nx=3, ny=2) >>> tuple(grid.dims) ('lat', 'lon')
Methods
|
|
Grid coordinates in both projected and geographic systems. |
|
|
Convert geographic coordinates to zero-based fractional grid indices. |
|
Return a GridWindow spanning the full horizontal domain. |
|
Build a new grid definition for a rectangular subset. |
|
Resolve a geographic bounding box to grid indices. |
Attributes
|
Return the calculated coordinate variables for this grid. |
Coordinate reference system for this grid. |
|
Get the dimension names for this grid. |
|
Check if this grid uses a lat-lon projection. |
|
Origin (lower-left corner) in the base CRS. |