improver.blending.blend_across_adjacent_points module¶
Module containing Blending classes that blend over adjacent points, as opposed to collapsing the whole dimension.
-
class
improver.blending.blend_across_adjacent_points.TriangularWeightedBlendAcrossAdjacentPoints(coord, central_point, parameter_units, width)[source]¶ Bases:
improver.BasePluginApply a Weighted blend to a coordinate, using triangular weights at each point in the coordinate. Returns a cube with the same coordinates as the input cube, with each point in the coordinate of interest having been blended with the adjacent points according to a triangular weighting function of a specified width.
-
__init__(coord, central_point, parameter_units, width)[source]¶ Set up for a Weighted Blending plugin
- Parameters
coord (str) – The name of a coordinate dimension in the cube that we will blend over.
central_point (float or int) – Central point at which the output from the triangular weighted blending will be calculated.
parameter_units (str) – The units of the width of the triangular weighting function and the units of the central_point. This does not need to be the same as the units of the coordinate we are blending over, but it should be possible to convert between them.
width (float) – The width of the triangular weighting function we will use to blend.
-
_abc_cache= <_weakrefset.WeakSet object>¶
-
_abc_negative_cache= <_weakrefset.WeakSet object>¶
-
_abc_negative_cache_version= 213¶
-
_abc_registry= <_weakrefset.WeakSet object>¶
-
_find_central_point(cube)[source]¶ Find the cube that contains the central point, otherwise, raise an exception.
- Parameters
cube (iris.cube.Cube) – Cube containing input for blending.
- Returns
Cube containing central point.
- Return type
- Raises
ValueError – Central point is not available within the input cube.
-
process(cube)[source]¶ Apply the weighted blend for each point in the given coordinate.
- Parameters
cube (iris.cube.Cube) – Cube containing input for blending.
- Returns
The processed cube, with the same coordinates as the input central_cube. The points in one coordinate will be blended with the adjacent points based on a triangular weighting function of the specified width.
- Return type
-