improver.cli.blend_adjacent_points module

Script to run weighted blending across adjacent points

process(*cubes, coordinate, central_point, units=None, width=None, calendar='gregorian', blend_time_using_forecast_period=False)[source]

Runs weighted blending across adjacent points.

Uses the TriangularWeightedBlendAcrossAdjacentPoints to blend across the dimension of a particular coordinate. It does not collapse the coordinate, but instead blends across adjacent points and puts the blended values back in the original coordinate, with adjusted bounds.

Parameters:
  • cubes (list of iris.cube.Cube) – A list of cubes including and surrounding the central point.

  • coordinate (str) – The coordinate over which the blending will be applied.

  • central_point (float) – Central point at which the output from the triangular weighted blending will be calculated. This should be in the units of the units argument that is passed in. This value should be a point on the coordinate for blending over.

  • units (str) – Units of the central_point and width.

  • width (float) – The width from the triangle’s centre point, in units of the units argument, which will determine the triangular weighting function used to blend that specified point with its adjacent points. Beyond this width the weighting drops to zero.

  • calendar (str) – Calendar for parameter_unit if required.

  • blend_time_using_forecast_period (bool) – If True, we are blending over time but using the forecast period coordinate as a proxy. Note, this should only be used when time and forecast_period share a dimension: i.e when all cubes provided are from the same forecast cycle.

Returns:

A processed cube, with the same coordinates as the input central_cube. The points in one dimension corresponding to the specified coordinate will be blended with the adjacent points based on a triangular weighting function of the specified width.

Return type:

iris.cube.Cube

Raises:
  • ValueError – If coordinate has “time” in it.

  • ValueError – If blend_time_forecast_period is not used with forecast_period coordinate.