improver.cli.recursive_filter module

Module to apply a recursive filter to neighbourhooded data.

process(cube, smoothing_coefficients, *, iterations=1)[source]

Module to apply a recursive filter to neighbourhooded data.

Run a recursive filter to convert a square neighbourhood into a Gaussian-like kernel or smooth over short distances. The filter uses a smoothing_coefficient (between 0 and 1) to control what proportion of the probability is passed onto the next grid-square in the x and y directions. The smoothing_coefficient can be set on a grid square by grid-square basis for the x and y directions separately (using two arrays of smoothing_coefficients of the same dimensionality as the domain).

Parameters
  • cube (iris.cube.Cube) – Cube to be processed.

  • smoothing_coefficients (iris.cube.CubeList) – CubeList describing the smoothing_coefficients to be used in the x and y directions.

  • iterations (int) – Number of times to apply the filter. (Typically < 3) Number of iterations should be 2 or less, higher values have been shown to lead to poorer conservation.

Returns

The processed Cube.

Return type

iris.cube.Cube