improver.cli.interpolate_using_difference module

Script to fill masked regions in a field using interpolation of the difference between it and a reference field.

process(cube, reference_cube, limit=None, *, limit_as_maximum=True)[source]

Uses interpolation to fill masked regions in the data contained within the input cube. This is achieved by calculating the difference between the input cube and a complete (i.e. complete across the whole domain) reference cube. The difference between the data in regions where they overlap is calculated and this difference field is then interpolated across the domain. Any masked regions in the input cube data are then filled with data calculated as the reference cube data minus the interpolated difference field.

Parameters:
  • cube (iris.cube.Cube) – A cube containing data in which there are masked regions to be filled.

  • reference_cube (iris.cube.Cube) – A cube containing data in the same units as the cube of data to be interpolated. The data in this cube must be complete across the entire domain.

  • limit (iris.cube.Cube) – A cube of limiting values to apply to the cube that is being filled in. This can be used to ensure that the resulting values do not fall below / exceed the limiting values; whether the limit values should be used as minima or maxima is determined by the limit_as_maximum option.

  • limit_as_maximum (bool) – If True the limit values are treated as maxima for the data in the interpolated regions. If False the limit values are treated as minima.

Returns:

Processed cube with the masked regions filled in through interpolation.

Return type:

iris.cube.Cube