meteodatalab.operators.vertical_reduction

Vertical reduction operators.

Functions

integrate_k(field, operator, mode, height, ...)

Integrate a field given on k levels on some height interval.

minmax_k(field, operator, mode, height, h_bounds)

Find the extremum of a field given on k levels on some height interval.

meteodatalab.operators.vertical_reduction.integrate_k(field, operator, mode, height, h_bounds, hsurf=None)[source]

Integrate a field given on k levels on some height interval.

Parameters:
  • field (xarray.DataArray) – field to reduce, defined either on model layer mid surfaces (typeOfLevel=”generalVerticalLayer”) or on model layer surfaces (typeOfLevel=”generalVertical”)

  • height (xarray.DataArray) – height field on model layer surfaces (typeOfLevel=”generalVertical”)

  • operator (str) – integral operator, possible values are “integral”, “normed_integral”

  • mode (str) – definition mode for height interval boundaries, possible values are “h2h”: height agl to height agl “h2z”: height agl to height amsl “z2h”: height amsl to height agl “z2z”: height amsl to height amsl

  • h_bounds (list of xarray.DataArray of length 2 height interval bounds) – (surface level field or single level of a multi-level field)

  • hsurf (Optional(xarray.DataArray)) – earth surface height in m amsl required if mode is one of {“h2h”, “h2z”, “z2h”}

Returns:

rfield – reduced field

Return type:

xarray.DataArray

meteodatalab.operators.vertical_reduction.minmax_k(field, operator, mode, height, h_bounds, hsurf=None)[source]

Find the extremum of a field given on k levels on some height interval.

Parameters:
  • field (xarray.DataArray) – field to reduce, defined either on model layer mid surfaces (typeOfLevel=”generalVerticalLayer”) or on model layer surfaces (typeOfLevel=”generalVertical”)

  • height (xarray.DataArray) – height field defined on the same typeOfLevel as the field to reduce

  • operator (str) – reduction operator, possible values are “maximum”, “minimum”

  • mode (str) – definition mode for height interval boundaries, possible values are “h2h”: height agl to height agl “h2z”: height agl to height amsl “z2h”: height amsl to height agl “z2z”: height amsl to height amsl

  • h_bounds (list of xarray.DataArray of length 2) – height interval bounds (surface level field or single level of a multi-level field)

  • hsurf (Optional(xarray.DataArray)) – earth surface height in m amsl required if mode is one of {“h2h”, “h2z”, “z2h”}

Returns:

rfield – reduced field

Return type:

xarray.DataArray