improver.cli.realization_selection module

Contents

improver.cli.realization_selection module#

Script to select realizations based on clustering results.

process(*cubes, forecast_period, model_id_attr='mosg__model_configuration')[source]#

Select realizations from input forecast cubes according to cluster assignments.

Parameters:
  • cubes (list of Cube) – List of input cubes, including forecast cubes and a cluster cube. The cluster cube is identified by the presence of the “primary_input_realization_to_cluster_medoid” attribute.

  • forecast_period (int) – The forecast period (in seconds) to use for interrogating the cluster mapping attributes in order to select the appropriate realizations.

  • model_id_attr (str) – The name of the cube attribute used to identify the model source.

Returns:

A merged Cube containing the selected realizations, with realization indices matching the cluster indices.

Return type:

Cube