improver.cli.temp_lapse_rate module

Script to calculate temperature lapse rates for given temperature and orogrophy datasets.

process(temperature, orography=None, land_sea_mask=None, *, max_height_diff=35, nbhood_radius=7, max_lapse_rate=0.0294, min_lapse_rate=-0.0098, dry_adiabatic=False, model_id_attr=None)[source]

Calculate temperature lapse rates in units of K m-1 over orography grid.

Parameters:
  • temperature (iris.cube.Cube) – Air temperature data. This is required even when returning DALR, as this defines the grid on which lapse rates are required.

  • orography (iris.cube.Cube) – Orography data.

  • land_sea_mask (iris.cube.Cube) – Binary land-sea mask data. True for land-points, False for sea.

  • max_height_diff (float) – Maximum allowable height difference between the central point and points in the neighbourhood over which the lapse rate will be calculated.

  • nbhood_radius (int) – Radius of neighbourhood in grid points around each point. The neighbourhood is a square array with side length 2*nbhood_radius + 1. The default value of 7 is from the reference paper (see plugin documentation).

  • max_lapse_rate (float) – Maximum lapse rate allowed, in K m-1.

  • min_lapse_rate (float) – Minimum lapse rate allowed, in K m-1.

  • dry_adiabatic (bool) – If True, returns a cube containing the dry adiabatic lapse rate rather than calculating the true lapse rate.

  • model_id_attr (str) – Name of the attribute used to identify the source model for blending. This is inherited from the input temperature cube.

Returns:

Lapse rate (K m-1)

Return type:

iris.cube.Cube

Raises:
  • ValueError – If minimum lapse rate is greater than maximum.

  • ValueError – If Maximum height difference is less than zero.

  • ValueError – If neighbourhood radius is less than zero.

  • RuntimeError – If calculating the true lapse rate and orography or land mask arguments are not given.