arlmet.IndexRecord#
- class arlmet.IndexRecord(header, source, forecast, minutes, pole_lat, pole_lon, tangent_lat, tangent_lon, grid_size, orientation, cone_angle, sync_x, sync_y, sync_lat, sync_lon, reserved, nx, ny, nz, vertical_flag, index_length, levels)[source]#
Index record describing one ARL time step and its contained variables.
- Parameters:
header (Header) – The header information for the index record.
source (str) – Source identifier (4 characters).
forecast (int) – Forecast hour.
minutes (int) – Minutes after the hour.
pole_lat (float) – Pole latitude position of the grid projection. For lat-lon grids: max latitude of the grid.
pole_lon (float) – Pole longitude position of the grid projection. For lat-lon grids: max longitude of the grid.
tangent_lat (float) – Reference latitude at which the grid spacing is defined. For conical and mercator projections, this is the latitude at which the grid touches the surface. For lat-lon grids: grid spacing in degrees latitude.
tangent_lon (float) – Reference longitude at which the grid spacing is defined. For conical and mercator projections, this is the longitude at which the grid touches the surface. 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) – Angle at the reference point made by the y-axis and the local direction of north. For lat-lon grids: 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. Stereographic: ±90, Mercator: 0, Lambert Conformal: 0 ~ 90 For lat-lon grids: 0
sync_x (float) – Grid x-coordinate used to equate a position on the grid with a position on earth. This is a unitless grid index (FORTRAN 1-based).
sync_y (float) – Grid y-coordinate used to equate a position on the grid with a position on earth. This is a unitless grid index (FORTRAN 1-based).
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.
nx (int) – Number of grid points in the x-direction (columns).
ny (int) – Number of grid points in the y-direction (rows).
nz (int) – Number of vertical levels.
vertical_flag (int) – Vertical coordinate system type (1=sigma, 2=pressure, 3=terrain, 4=hybrid).
index_length (int) – Total length of the index record in bytes, including fixed and variable portions.
levels (sequence of LvlInfo) – Variable manifests for each stored vertical level.
- time#
The valid time of the record, calculated from the header time and minutes.
- Type:
pd.Timestamp
Examples
>>> from arlmet.header import Header >>> from arlmet.index import IndexRecord >>> header = Header( ... year=2024, ... month=7, ... day=18, ... hour=0, ... forecast=0, ... level=0, ... grid=(0, 0), ... variable="INDX", ... exponent=0, ... precision=0.0, ... initial_value=0.0, ... ) >>> isinstance(header.time, pd.Timestamp) True
Methods
|
|
|
Create an IndexRecord by reading from a file at a specific position. |
|
Parse the variable-length portion of an index record. |
|
Parse the fixed 108-byte portion of an index record from raw bytes. |
|
Serialize the variable-length level/variable portion of the index record. |
|
Serialize the fixed 108-byte portion of the index record. |
|
Serialize the index record padded to one full ARL record. |
Serialize the exact used bytes of the index record, including its header. |
Attributes
|
Construct a Grid from the index record's projection parameters. |
Valid time calculated from header time plus minutes offset. |
|
|
Total x grid points including thousands from header grid letters. |
|
Total y grid points including thousands from header grid letters. |
|
Construct the vertical axis definition from the index record. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|