improver.precipitation_type.convection module

Module containing convection diagnosis utilities.

class ConvectionRatioFromComponents[source]

Bases: BasePlugin

Diagnose the convective precipitation ratio by using differences between convective and dynamic components.

_abc_impl = <_abc_data object>
_convective_ratio()[source]

Calculates the convective ratio from the convective and dynamic precipitation rate components, masking data where both are zero. The tolerance for comparing with zero is 1e-9 m s-1.

Return type:

ndarray

static _get_cube(cubes, name)[source]

Get one cube named “name” from the list of cubes and set its units to m s-1.

Parameters:
Return type:

Cube

Returns:

Cube with units set

_split_input(cubes)[source]

Extracts convective and dynamic components from the list as objects on the class and ensures units are m s-1

Return type:

None

process(cubes, model_id_attr=None)[source]
Calculate the convective ratio from the convective and dynamic components as:

convective_ratio = convective / (convective + dynamic)

If convective + dynamic is zero, then the resulting point is masked.

Parameters:
  • cubes (List[Cube]) – Both the convective and dynamic components as iris.cube.Cube in a list with names ‘lwe_convective_precipitation_rate’ and ‘lwe_stratiform_precipitation_rate’

  • model_id_attr (Optional[str]) – Name of the attribute used to identify the source model for blending. This is inherited from the input temperature cube.

Return type:

Cube

Returns:

Cube containing the convective ratio.