arlmet.DataRecord#

class arlmet.DataRecord(recordset, position, level, variable, forecast=None, checksum=None, reserved=None)[source]#

One ARL data record representing a single 2D variable slice.

Parameters:
  • recordset (RecordSet) – Parent record set for the record.

  • position (int) – Byte offset of the record on disk, or -1 for a writable in-memory record.

  • level (int) – ARL vertical level index.

  • variable (str) – Four-character ARL variable name.

  • forecast (int | None) – Forecast hour required when constructing a writable record.

  • checksum (int | None) – Stored ARL checksum from the index record.

  • reserved (str | None) – Reserved one-character metadata from the index record.

Variables:
  • ndim (int) – NumPy-style dimensionality, always 2.

  • recordset (RecordSet) – Parent record set.

  • position (int) – Byte position of the record in the file.

  • level (int) – ARL level index.

  • variable (str) – Variable name for the record.

Attributes

bytes

Get the packed bytes for this data record.

checksum

Get the stored checksum for this data record.

data

Get the data for this record.

diffs

The DIF* records that correct this record, in stream order.

dtype

Data type of the unpacked data (float32 until the data is read).

forecast

Get the forecast hour for this data record.

grid

Get the grid associated with this data record.

header

Header of this data record.

mode

Access mode of the record, inferred from its position.

n_bytes

Get the number of bytes in the packed data record (including the header).

shape

Return the shape of the data grid.

source

Get the source associated with this data record.

time

Get the time associated with this data record.

vertical_axis

Get the vertical axis associated with this data record.

Methods

read([window])

Read and unpack this record from disk.

to_xarray(*[, squeeze])

Convert this DataRecord to an xarray.DataArray.

verify_checksum()

Verify the packed payload against the checksum stored in metadata.