arlmet.VerticalAxis#

class arlmet.VerticalAxis(levels, *, offset=0.0)[source]#

Bases: ABC

Abstract base class for ARL vertical coordinate axes.

Use from_flag() to construct from a raw ARL flag integer, or instantiate a subclass directly (e.g. PressureAxis(levels=[...])).

Vertical axes are immutable value objects: levels is a read-only NumPy array, attributes cannot be reassigned, and equal axes hash equally. Build a new axis to change one.

Parameters:
  • levels (ArrayLike) – Native level values stored in the file (1-D).

  • offset (float) – Pressure offset [hPa] stored in the index record: the sigma offset, or WRF’s model-top pressure for flag 5.

Variables:
  • flag (int) – ARL vertical coordinate flag (1=sigma, 2=pressure, 3=terrain, 4=hybrid, 5=WRF).

  • coord_system (str) – Human-readable coordinate system name.

  • levels (numpy.ndarray) – Read-only float64 array of native level values.

  • offset (float) – Pressure offset stored in the index record.

Methods

from_flag(flag, levels, *[, offset])

Construct the appropriate subclass from an ARL vertical flag.

to_height_agl(*[, surface_pressure, ...])

Compute height above ground level [m] at each level.

to_pressure(*[, surface_pressure])

Compute pressure [hPa] at each level.