improver.lightning module
Module containing lightning classes.
- class LightningFromCapePrecip[source]
Bases:
PostProcessingPlugin
Apply latitude-dependent thresholds to CAPE and precipitation rate to derive a presence-of-lightning cube.
Lightning is based on the presence of both CAPE and precipitation rate with thresholds varying linearly between
CAPE (J kg-1)
Precipitation rate (mm h-1)
Mid-latitudes (above 50 degrees N or S)
350
1
Tropics (below 10 degrees N or S)
500
4
- _abc_impl = <_abc_data object>
- static _get_inputs(cubes)[source]
Separates CAPE and precipitation rate cubes and checks that the following match: forecast_reference_time, spatial coords, time-bound interval and that CAPE time is at the lower bound of precipitation rate time. The precipitation rate data must represent a period of 1 or 3 hours.
- process(cubes, model_id_attr=None)[source]
From the supplied CAPE and precipitation-rate cubes, calculate a probability of lightning cube.
- Parameters:
- Return type:
- Returns:
Cube of lightning data
- Raises:
ValueError – If one of the cubes is not found or doesn’t match the other
- latitude_to_threshold(latitude, midlatitude, tropics)[source]
Rescale a latitude range into a range of threshold values suitable for thresholding a different diagnostic. This is based on the value provided for that diagnostic at midlatitude (more than 50 degrees from the equator) and in the tropics (closer than 10 degrees from the equator). Varies linearly in between.
- Parameters:
- Return type:
- Returns:
An array of thresholds, one for each latitude point