improver.precipitation_type.calculate_sleet_prob module

A plugin to calculate probability of sleet

calculate_sleet_probability(prob_of_snow, prob_of_rain)[source]

This calculates the probability of sleet using the calculation: prob(sleet) = 1 - (prob(snow) + prob(rain))

Parameters:
  • prob_of_snow (Cube) – Cube of the probability of snow. This can be a fraction (0 <= x <= 1) or categorical (0 or 1)

  • prob_of_rain (Cube) – Cube of the probability of rain. This can be a fraction (0 <= x <= 1) or categorical (0 or 1)

Return type:

Cube

Returns:

Cube of the probability of sleet. This will be fractional or categorical, matching the highest precision of the inputs.

Raises:

ValueError – If the cube contains negative values for the the probability of sleet.