improver.cli.categorical_modes module

CLI to generate modal categories over periods.

process(*cubes, decision_tree=None, model_id_attr=None, record_run_attr=None)[source]

Generates a modal category for the period covered by the input categorical cubes. Where there are different categories available for night and day, the modal code returned is always a day code, regardless of the times covered by the input files. Designed for use with weather symbol data.

Parameters:
  • cubes (iris.cube.CubeList) – A cubelist containing categorical cubes that cover the period over which a modal category is desired.

  • decision_tree (dict) – A JSON file containing a decision tree definition.

  • model_id_attr (str) – Name of attribute recording source models that should be inherited by the output cube. The source models are expected as a space-separated string.

  • record_run_attr (Optional[str]) – Name of attribute used to record models and cycles used in constructing the categorical data.

Returns:

A cube of modal categories over a period.

Return type:

iris.cube.Cube