improver.precipitation_type.utilities module

Utilities for use by precipitation_type plugins / functions.

make_shower_condition_cube(cube, in_place=False)[source]

Modify the input cube’s metadata and coordinates to produce a shower condition proxy. The input cube is expected to possess a single valued threshold coordinate.

Parameters:
  • cube (Cube) – A thresholded diagnostic to be used as a proxy for showery conditions. The threshold coordinate should contain only one value, which denotes the key threshold that above which conditions are showery, and below which precipitation is more likely dynamic.

  • in_place (bool) – If set true the cube is modified in place. By default a modified copy is returned.

Return type:

Cube

Returns:

A shower condition probability cube that is an appropriately renamed version of the input with an updated threshold coordinate representing the probability of shower conditions occurring.

Raises:
  • CoordinateNotFoundError – Input has no threshold coordinate.

  • ValueError – Input cube’s threshold coordinate is multi-valued.