improver.cli.apply_rainforests_calibration module

CLI to apply rainforests calibration.

process(forecast, *features, model_config, error_percentiles_count=19, output_realizations_count=100, threads=1)[source]

Calibrate a forecast cube using the Rainforests method.

Ensemble forecasts must be in realization representation. Deterministic forecasts can be processed to produce a pseudo-ensemble; a realization dimension will be added to deterministic forecast cubes if one is not already present.

This calibration is done in a situation dependent fashion using a series of decision-tree models to construct representative error distributions which are then used to map each input ensemble member onto a series of realisable values. These series collectively form a super-ensemble, from which realizations are sampled to produce the calibrated forecast.

Parameters
  • forecast_cube (iris.cube.Cube) – Cube containing the forecast to be calibrated; must be as realizations.

  • feature_cubes (iris.cube.Cubelist) – Cubelist containing the feature variables (physical parameters) used as inputs to the tree-models for the generation of the associated error distributions. Feature cubes are expected to have the same dimensions as forecast_cube, with the exception of the realization dimension. Where the feature_cube contains a realization dimension this is expected to be consistent, otherwise the cube will be broadcast along the realization dimension.

  • model_config (dict) – Dictionary containing RainForests model configuration data.

  • error_percentiles_count (int) – The number of error percentiles to apply to each ensemble realization. The resulting super-ensemble will be of size = forecast.realization.size * error_percentiles_count.

  • output_realizations_count (int) – The number of realizations to output for the calibrated ensemble. These realizations are sampled by taking equispaced percentiles from the super-ensemble. If None is supplied, then all realizations from the super-ensemble will be returned.

  • threads (int) – Number of threads to use during prediction with tree-model objects.

Returns

The forecast cube following calibration.

Return type

iris.cube.Cube