arlmet.VerticalAxis#

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

Vertical coordinate metadata for an ARL file.

Parameters:
  • flag (int) – ARL vertical coordinate flag. Supported values include 1 (sigma), 2 (pressure), 3 (terrain-following), 4 (hybrid), and 5 (WRF).

  • levels (sequence of float) – Native level values stored in the file.

  • offset (float, default 0.0) – Pressure offset used by sigma and hybrid coordinate conversions.

flag#

Raw ARL vertical flag.

Type:

int

coord_system#

Human-readable coordinate system name.

Type:

str

levels#

Copy of the stored level values.

Type:

numpy.ndarray

offset#

Pressure offset for sigma or hybrid coordinates.

Type:

float

calculate_coords()[source]#

Return the native level coordinate values.

sigma_to_pressure(surface_pressure, levels)[source]#

Convert sigma or hybrid levels to pressure at sample points.

Examples

>>> from arlmet.vertical import VerticalAxis
>>> axis = VerticalAxis(flag=2, levels=[1000.0, 925.0, 850.0])
>>> axis.coord_system
'pressure'
>>> axis.calculate_coords()["level"].tolist()
[1000.0, 925.0, 850.0]

Methods

VerticalAxis.__init__(flag, levels, *[, offset])

VerticalAxis.calculate_coords()

Return the native level coordinate values stored in the file.

VerticalAxis.sigma_to_pressure(...)

Compute per-point pressure at each level for sigma or hybrid axes.

Attributes