improver.cli.generate_percentiles module

Script to collapse cube coordinates and calculate percentiled data.

process(cube, *, coordinates=None, percentiles=None, ignore_ecc_bounds_exceedance=False)[source]

Collapses cube coordinates and calculate percentiled data.

Calculate percentiled data over a given coordinate by collapsing that coordinate. Typically used to convert realization data into percentiled data, but may calculate over any dimension coordinate. Alternatively calling this with a dataset containing probabilities will convert those to percentiles using the ensemble coupla coupling plugin. If no particular percentiles are given at which to calculate values and no ‘number of percentiles’ to calculate are specified, the following defaults will be used. ‘[0, 5, 10, 20, 25, 30, 40, 50, 60, 70, 75, 80, 90, 95, 100]’

Parameters
  • cube (iris.cube.Cube) – A Cube for processing.

  • coordinates (str or list) – Coordinate or coordinates over which to collapse data and calculate percentiles; e.g. ‘realization’ or ‘latitude,longitude’. This argument must be provided when collapsing a coordinate or coordinates to create percentiles, but is redundant when converting probabilities to percentiles and may be omitted. This coordinate(s) will be removed and replaced by a percentile coordinate.

  • percentiles (list) – Optional definition of percentiles at which to calculate data.

  • ignore_ecc_bounds_exceedance (bool) – If True, where calculated percentiles are outside the ECC bounds range, raises a warning rather than an exception.

Returns

The processed Cube.

Return type

iris.cube.Cube

Raises

ValueError – If the cube name does not contain ‘probability_of_’ and coordinates isn’t used.

Warns

Warning – If ‘probability_of_’ is in the cube name and coordinates is used.