improver.cli.vicinity module

Script to apply vicinity neighbourhoods to data.

process(cube, vicinity=None)[source]

Module to apply vicinity processing to data.

Calculate the maximum value within a vicinity radius about each point in each x-y slice of the input cube.

If working with thresholded data, using this CLI to calculate a neighbourhood maximum ensemble probability, the vicinity process must be applied prior to averaging across the ensemble, i.e. collapsing the realization coordinate. A typical chain might look like:

threshold –> vicinity –> realization collapse

Note that the threshold CLI can be used to perform this series of steps in a single call without intermediate output.

Users should ensure they do not inadvertently apply vicinity processing twice, once within the threshold CLI and then again using this CLI.

Parameters:
  • cube (iris.cube.Cube) – A cube containing data to which a vicinity is to be applied.

  • vicinity (list of float / int) – List of distances in metres used to define the vicinities within which to search for an occurrence. Each vicinity provided will lead to a different gridded field.

Returns:

Cube with the vicinity processed data.

Return type:

iris.cube.Cube