improver.pollen.pollen_index_for_period module#

Calculations to produce Pollen Indexes for a period (Hourly or Daily).

class PollenIndexForPeriod[source]#

Bases: PostProcessingPlugin

Plugin to calculate a Pollen Index cube for either Daily or Hourly.

Pollen Concentration values in the input cube are compared with threshold values appropriate for the pollen taxa represented by the cube, and categorized as indexes 0 to 4 for each grid point.

_POLLEN_INDEX = {'alder': array([0.e+00, 1.e-02, 3.e+01, 5.e+01, 8.e+01, 5.e+03]), 'ash': array([0.e+00, 1.e-02, 3.e+01, 5.e+01, 2.e+02, 5.e+03]), 'birch': array([0.e+00, 1.e-02, 4.e+01, 8.e+01, 2.e+02, 5.e+03]), 'grass': array([0.0e+00, 1.0e-02, 3.0e+01, 5.0e+01, 1.5e+02, 5.0e+03]), 'hazel': array([0.e+00, 1.e-02, 3.e+01, 5.e+01, 8.e+01, 5.e+03]), 'index': array([0, 1, 2, 3, 4, 5], dtype=int32), 'nettle': array([0.e+00, 1.e-02, 4.e+01, 8.e+01, 2.e+02, 5.e+03]), 'oak': array([0.e+00, 1.e-02, 3.e+01, 5.e+01, 2.e+02, 5.e+03]), 'plane': array([0.e+00, 1.e-02, 3.e+01, 5.e+01, 2.e+02, 5.e+03]), 'weed': array([0.e+00, 1.e-02, 4.e+01, 8.e+01, 2.e+02, 5.e+03])}#

Threshold index levels - minimum value (grains/m3) for each index.

_abc_impl = <_abc._abc_data object>#
_calculate(taxa)[source]#

Calculate the Pollen Index.

Use values in _POLLEN_INDEX to determine the pollen index for each grid point.

Parameters:

taxa (str) – The pollen taxa being processed, used to update the cube name and metadata

_metadata(taxa)[source]#

Change the cube name and other metadata. :type taxa: str :param taxa: The pollen taxa being processed, used to update the cube name and metadata

_output_cube = None#
process(cube)[source]#

Calculate the Pollen Index.

Use values in _POLLEN_INDEX to determine the pollen index for each grid point, based on the pollen concentration values in the input cube.

Parameters:

cube (Cube) – Input cube of hourly or daily pollen concentrations for a specific pollen type

Return type:

Cube

Returns:

The calculated output cube.

Warns:

UserWarning – If output values fall outside typical expected ranges