improver.cli.generate_realizations module

Convert NetCDF files to realizations.

process(cube, raw_cube=None, *, realizations_count=None, random_seed=None, ignore_ecc_bounds_exceedance=False, skip_ecc_bounds=False)[source]

Converts an incoming cube into one containing realizations.

Parameters:
  • cube (iris.cube.Cube) – A cube to be processed.

  • raw_cube (iris.cube.Cube) – Cube of raw (not post processed) weather data. If this argument is given ensemble realizations will be created from percentiles by reshuffling them in correspondence to the rank order of the raw ensemble. Otherwise, the percentiles are rebadged as realizations.

  • realizations_count (int) – The number of ensemble realizations in the output.

  • random_seed (int) – Option to specify a value for the random seed when reordering percentiles. This value is for testing purposes only, to ensure reproduceable outputs. It should not be used in real time operations as it may introduce a bias into the reordered forecasts.

  • ignore_ecc_bounds_exceedance (bool) – If True where percentiles (calculated as an intermediate output before realization) exceed the ECC bounds range, raises a warning rather than an exception.

  • skip_ecc_bounds (bool) – If True, ECC bounds are not included either when percentiles are resampled as an intermediate step prior to creating realizations or when probabilities are converted to percentiles as an intermediate step prior to creating realizations. This has the effect that percentiles outside of the range given by the input percentiles will be computed by nearest neighbour interpolation from the nearest available percentile, rather than using linear interpolation between the nearest available percentile and the ECC bound.

Returns:

The processed cube.

Return type:

iris.cube.Cube