arlmet.record.Header#
- class arlmet.record.Header(year, month, day, hour, forecast, level, grid, variable, exponent, precision, initial_value)[source]#
Fixed-width 50-byte header present at the start of every ARL record.
Headers are immutable value objects; use
dataclasses.replace()to derive a modified copy.- Parameters:
year (
int) – Valid time components stored in the record header.month (
int) – Valid time components stored in the record header.day (
int) – Valid time components stored in the record header.hour (
int) – Valid time components stored in the record header.forecast (
int) – Forecast hour associated with the record. The label holds two digits, sotobytes()writesmin(forecast, 99), as HYSPLIT’spakrecdoes (an index record keeps the full hour, up to 999, in its own field).level (
int) – ARL vertical level index: 0 for the surface, then 1 toMAX_LEVELfrom the ground up. The header holds it in two characters.grid (
tuple[int,int]) – Thousands part of the x and y grid sizes, as stored in the header’s two grid characters ((1000, 0)for a 1799x799 grid, writtenA@;(0, 0)below 1000 points, written99). The remainders live in the index record, whosenx/nyare the full sizes.variable (
str) – Four-character ARL variable name.exponent (
int) – Differential packing exponent.precision (
float) – Packed-data precision used during unpacking.initial_value (
float) – Initial grid value at the start of the differential packing stream.
- Variables:
Attributes
Timestamp reconstructed from the header date fields. |
Methods
|
Parse header from raw bytes. |
|
Serialize the header to its fixed-width ASCII representation. |