Skip to content

DerivedPressureLevels

GlobalNVIDIAPyTorch

Import path: earth2studio.models.dx.DerivedPressureLevels

View source on GitHub

Documentation

Bases: _DerivedDiagnostic

Interpolates fields from model or pressure levels onto pressure levels.

Interpolation is linear in the logarithm of pressure, column by column. Levels are read from the lexicon's variable names: {variable}{p} on pressure level p hPa, or {variable}{k}{level_suffix} on model level k, such as t12k (ERA5, ACE) or t12hl (HRRR). Outputs are {variable}{p} on each target level. Inputs come in one of three forms:

  • input_levels: pressure levels, such as t850.
  • model_levels with a and b: hybrid sigma-pressure model levels, p = a + b * sp, plus surface pressure sp in Pa as the last input.
  • model_levels with pressure: model levels of any kind whose pressure the model publishes as a field on each level, such as HRRR's p{k}hl in Pa.

Used between coupled models, it maps one model's levels onto another's.

Parameters:

  • variables (list[str]) –

    Variables to interpolate, such as ["t", "u", "v"].

  • levels (list[float]) –

    Target pressure levels in hPa.

  • input_levels (list[float] | None, default: None ) –

    Pressure levels of the inputs in hPa, by default None

  • model_levels (list[int] | None, default: None ) –

    Model level numbers of the inputs, as named in the lexicon (e.g. 1-137 for ERA5), from the top of the model down, by default None

  • a (Sequence[float] | None, default: None ) –

    Hybrid pressure coefficients in Pa: one per model level, or one per interface (len(model_levels) + 1, as ECMWF publishes them), in which case each level takes the mean pressure of its interfaces, by default None

  • b (Sequence[float] | None, default: None ) –

    Hybrid surface-pressure coefficients, shaped like a, by default None

  • pressure (str | None, default: None ) –

    Variable holding each model level's pressure in Pa, by default None

  • level_suffix (str, default: 'k' ) –

    Suffix marking model levels in variable names, by default "k"; HRRR's hybrid levels use "hl"

  • grid (str | GridDefinition, default: 'latlon-0.25deg' ) –

    Spatial grid configured before coordinate planning, by default "latlon-0.25deg"

  • fill_value (float | None, default: None ) –

    Value for target levels outside a column, such as below the surface, by default None, which takes the nearest level's value.

__call__

__call__(x: DataArray) -> DataArray

Compute derived fields on the input device.

Parameters:

  • x (DataArray) –

    NumPy- or CuPy-backed input with the declared trailing dimensions.

Returns:

  • DataArray –

    Derived fields with the input name, encoding and unaffected metadata.