arlmet.Header#

class arlmet.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.

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.

  • level (int) – ARL vertical level index.

  • grid (tuple[int, int]) – Thousands-encoded x and y grid header components.

  • 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.

N_BYTES#

Fixed serialized size of the header.

Type:

int

time#

Timestamp reconstructed from the header date fields.

Type:

pandas.Timestamp

from_bytes(data)[source]#

Parse a Header from raw bytes.

tobytes()[source]#

Serialize the header to its fixed-width ASCII representation.

Methods

Header.__init__(year, month, day, hour, ...)

Header.from_bytes(data)

Parse header from raw bytes.

Header.tobytes()

Serialize the header to its fixed-width ASCII representation.

Attributes

Header.FIELDS

Header.N_BYTES

Header.time

Timestamp reconstructed from the header date fields.

Header.year

Header.month

Header.day

Header.hour

Header.forecast

Header.level

Header.grid

Header.variable

Header.exponent

Header.precision

Header.initial_value