improver.cli.precipitation_duration module

Contents

improver.cli.precipitation_duration module#

Script to calculate the fraction of a long period in which precipitation reaches a given classification.

process(*cubes, min_accumulation_per_hour, critical_rate, target_period, percentiles, accumulation_diagnostic='probability_of_lwe_thickness_of_precipitation_amount_above_threshold', rate_diagnostic='probability_of_lwe_precipitation_rate_above_threshold', model_id_attr=None)[source]#

Classifies periods of precipitation intensity using both the maximum precipitation rate in the period and the accumulation in the period. These classified periods are then used to determine what fraction of a constructed longer period would be classified as such.

Parameters:
  • cubes (iris.cube.CubeList) –

    Cubes covering the expected period that include cubes of:

    max_precip_rate: Maximum precipitation rate in a period. precip_accumulation: Precipitation accumulation in a period. The periods of these two diagnostics must be the same.

  • min_accumulation_per_hour (comma_separated_list) – The minimum accumulation per hour in the period, or a list of several, used to classify the period. The accumulation is used in conjuction with the critical rate. Units of mm.

  • critical_rate (comma_separated_list) – A rate threshold, or list of rate thresholds, which if the maximum rate in the period is in excess of contributes to classifying the period. Units of mm/hr.

  • target_period (float) – The period in hours that the final diagnostic represents. This should be equivalent to the period covered by the inputs. Specifying this explicitly here is entirely for the purpose of checking that the returned diagnostic represents the period that is expected. Without this a missing input file could lead to a suddenly different overall period.

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

  • accumulation_diagnostic (str) – The expected diagnostic name for the accumulation in period diagnostic. Used to extract the cubes from the inputs.

  • rate_diagnostic (str) – The expected diagnostic name for the maximum rate in period diagnostic. Used to extract the cubes from the inputs.

  • model_id_attr (str) – Name of the attribute used to identify the source model for blending.

Returns:

Returns a cube with the combined data.

Return type:

result (iris.cube.Cube)