improver.wind_calculations.wind_gust_diagnostic module

Module containing plugin for WindGustDiagnostic.

class improver.wind_calculations.wind_gust_diagnostic.WindGustDiagnostic(percentile_gust, percentile_windspeed)[source]

Bases: improver.BasePlugin

Plugin for calculating wind-gust diagnostic.

In the model a shear-driven turbulence parameterization is used to estimate wind gusts but in convective situations this can over-estimate the convective gust. This diagnostic takes the Maximum of the values at each grid point of * a chosen percentile of the wind-gust forecast and * a chosen percentile of the wind-speed forecast to produce a better estimate of wind-gust. For example a typical wind-gust could be MAX(gust(50%),windspeed(95%)) an extreme wind-gust forecast could be MAX(gust(95%), windspeed(100%))

Scientific Reference: Roberts N., Mylne K. Poster - European Meteorological Society Conference 2017.

See https://github.com/metoppv/improver/files/1244828/WindGustChallenge_v2.pdf for a discussion of the problem and proposed solutions.

__init__(percentile_gust, percentile_windspeed)[source]

Create a WindGustDiagnostic plugin for a given set of percentiles.

Parameters
  • percentile_gust (float) – Percentile value required from wind-gust cube.

  • percentile_windspeed (float) – Percentile value required from wind-speed cube.

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

Add metadata to cube for windgust diagnostic.

Parameters

cube (iris.cube.Cube) – Cube containing the wind-gust diagnostic data.

Returns

Cube containing the wind-gust diagnostic data with corrected Metadata.

Return type

iris.cube.Cube

static extract_percentile_data(cube, req_percentile, standard_name)[source]

Extract percentile data from cube.

Parameters
  • cube (iris.cube.Cube) – Cube contain one or more percentiles.

  • req_percentile (float) – Required percentile value

  • standard_name (str) – Standard name of the data.

Returns

tuple containing:
result (iris.cube.Cube):

Cube containing the required percentile data

perc_coord (iris.coords.Coord):

Percentile coordinate.

Return type

(tuple)

process(cube_gust, cube_ws)[source]

Create a cube containing the wind_gust diagnostic.

Parameters
  • cube_gust (iris.cube.Cube) – Cube contain one or more percentiles of wind_gust data.

  • cube_ws (iris.cube.Cube) – Cube contain one or more percentiles of wind_speed data.

Returns

Cube containing the wind-gust diagnostic data.

Return type

iris.cube.Cube

static update_metadata_after_max(cube, perc_coord)[source]

Update metadata after MAX found through merged_cube.collapsed

Parameters
Returns

Cube containing the wind-gust diagnostic data with corrected Metadata.

Return type

iris.cube.Cube