improver.psychrometric_calculations.precip_phase_probability module

Module for calculating the probability of specific precipitation phases.

class improver.psychrometric_calculations.precip_phase_probability.PrecipPhaseProbability(radius=10000.0)[source]

Bases: improver.BasePlugin

This plugin converts a falling-phase-change-level cube into the probability of a specific precipitation phase being found at the surface.

For snow; the 80th percentile is taken from a neighbourhood around each point and is compared with the orography. Where the orography is higher, the returned probability-of-snow is 1, else 0. For rain, the above method is modified to get the 20th percentile and where the orography is lower than the percentile value, the returned probability-of-rain is 1, else 0.

__init__(radius=10000.0)[source]

Initialise plugin :param radius: Neighbourhood radius from which 80th percentile is found (m) :type radius: float

_abc_cache = <_weakrefset.WeakSet object>
_abc_negative_cache = <_weakrefset.WeakSet object>
_abc_negative_cache_version = 213
_abc_registry = <_weakrefset.WeakSet object>
_extract_input_cubes(cubes)[source]

Separates the input list into the required cubes for this plugin, detects whether snow or rain are required from the input phase-level cube name and appropriately initialises the percentile_plugin, sets the appropriate comparator operator for comparing with orography and the unique part of the output cube name.

Converts units of falling_level_cube to that of orography_cube if necessary. Sets flag for snow or rain depending on name of falling_level_cube.

Parameters

cubes (iris.cube.CubeList or list) – Contains cubes of the altitude of the phase-change level (this can be snow->sleet, or sleet->rain) and the altitude of the orography. The name of the phase-change level cube must be either “altitude_of_snow_falling_level” or “altitude_of_rain_falling_level”. The name of the orography cube must be “surface_altitude”.

Raises
  • ValueError – If cubes with the expected names cannot be extracted.

  • ValueError – If cubes does not have the expected length of 2.

  • ValueError – If the extracted cubes do not have matching spatial coordinates.

process(cubes)[source]

Derives the probability of a precipitation phase at the surface. If the snow-sleet falling-level is supplied, this is the probability of snow at (or below) the surface. If the sleet-rain falling-level is supplied, this is the probability of rain at (or above) the surface.

Parameters

cubes (iris.cube.CubeList or list) – Contains cubes of the altitude of the phase-change level (this can be snow->sleet, or sleet->rain) and the altitude of the orography.

Returns

Contains the probability of a specific precipitation phase reaching the surface orography. If the falling_level_cube was snow->sleet, then this will be the probability of snow at the surface. If the falling_level_cube was sleet->rain, then this will be the probability of rain at the surface. The probabilities are categorical (1 or 0) allowing precipitation to be divided uniquely between snow, sleet and rain phases.

Return type

iris.cube.Cube