arlmet.grid#
Grid and projection definitions for ARL meteorological data.
This module provides classes for representing ARL grid projections and coordinate systems, including horizontal grids, vertical axes, and 3D grids. Supports various map projections (lat-lon, polar stereographic, Lambert conformal, Mercator) used in ARL meteorological files.
Functions
|
Wrap longitude values to -180 to 180 degree range. |
Classes
|
Represents the horizontal grid of the ARL data. |
|
|
|
ARL Grid Projection |
|
- arlmet.grid.wrap_lons(lons)[source]#
Wrap longitude values to -180 to 180 degree range.
- Parameters:
lons (np.ndarray) – Longitude values in degrees
- Returns:
Longitude values wrapped to [-180, 180] range
- Return type:
np.ndarray
- class arlmet.grid.Projection(pole_lat, pole_lon, tangent_lat, tangent_lon, grid_size, orientation, cone_angle, sync_x, sync_y, sync_lat, sync_lon, reserved)[source]#
ARL Grid Projection
- Parameters:
pole_lat (float) – Pole latitude position of the grid projection. Most projections will be defined at +90 or -90 depending upon the hemisphere. For lat-lon grids: latitude of the grid point with the maximum grid point value.
pole_lon (float) – Pole longitude position of the grid projection. The longitude 180 degrees from which the projection is cut. For lat-lon grids: longitude of the grid point with the maximum grid point value.
tangent_lat (float) – Reference latitude at which the grid spacing is defined. For lat-lon grids: grid spacing in degrees latitude.
tangent_lon (float) – Reference longitude at which the grid spacing is defined. For lat-lon grids: grid spacing in degrees longitude.
grid_size (float) – Grid spacing in km at the reference position. For lat-lon grids: value of zero signals that the grid is a lat-lon grid.
orientation (float) – Grid orientation or the angle at the reference point made by the y-axis and the local direction of north. For lat-lon grids: value always = 0.
cone_angle (float) – Angle between the axis and the surface of the cone. For regular projections it equals the latitude at which the grid is tangent to the earth’s surface. Polar stereographic: ±90, Mercator: 0, Lambert Conformal: between limits, Oblique stereographic: 90. For lat-lon grids: value always = 0.
sync_x (float) – Grid x-coordinate used to equate a position on the grid with a position on earth (paired with sync_y, sync_lat, sync_lon).
sync_y (float) – Grid y-coordinate used to equate a position on the grid with a position on earth (paired with sync_x, sync_lat, sync_lon).
sync_lat (float) – Earth latitude corresponding to the grid position (sync_x, sync_y). For lat-lon grids: latitude of the (0,0) grid point position.
sync_lon (float) – Earth longitude corresponding to the grid position (sync_x, sync_y). For lat-lon grids: longitude of the (0,0) grid point position.
reserved (float) – Reserved for future use.
- crs#
The pyproj CRS object representing the base grid projection. The projection is defined without false easting/northing offsets.
- Type:
pyproj.CRS
- property is_latlon: bool#
Check if this is a lat-lon grid.
- Returns:
True if grid_size is 0 (indicating a lat-lon grid), False otherwise.
- Return type:
- __init__(pole_lat, pole_lon, tangent_lat, tangent_lon, grid_size, orientation, cone_angle, sync_x, sync_y, sync_lat, sync_lon, reserved)#
- class arlmet.grid.Grid(projection, nx, ny)[source]#
Represents the horizontal grid of the ARL data.
- Parameters:
proj (Projection) – The grid projection information.
nx (int) – Number of grid points in the x-direction (columns).
ny (int) – Number of grid points in the y-direction (rows).
- origin#
Origin (lower-left corner) in the base CRS (projected coordinates).
- crs#
Coordinate reference system for the grid.
- Type:
pyproj.CRS
- coords#
Coordinates of the grid points in the base CRS (projected coordinates).
- property is_latlon: bool#
Check if this grid uses a lat-lon projection.
- Returns:
True if the projection is lat-lon, False otherwise.
- Return type:
- property dims: tuple#
Get the dimension names for this grid.
- Returns:
(“lat”, “lon”) for lat-lon grids, (“y”, “x”) for projected grids.
- Return type:
- property crs: CRS#
Coordinate reference system for this grid.
- Returns:
Coordinate reference system with false easting/northing applied.
- Return type:
pyproj.CRS
- class arlmet.grid.Grid3D(projection, nx, ny, vertical_axis)[source]#
-
- property dims: tuple#
Get the dimension names for this 3D grid.
- Returns:
(“level”, “lat”, “lon”) for lat-lon grids, (“level”, “y”, “x”) for projected grids.
- Return type: