improver.regrid.landsea2 module

Plugin to regrid using custom nearest and bilinear methods, both with land-sea awareness

class RegridWithLandSeaMask(regrid_mode='bilinear-2', vicinity_radius=25000.0)[source]

Bases: PostProcessingPlugin

Nearest-neighbour and bilinear regridding with or without land-sea mask awareness. When land-sea mask considered, surface-type-mismatched source points are excluded from field regridding calculation for target points. Note: regrid_mode options are “nearest-2”, “nearest-with-mask-2”,”bilinear-2”, and “bilinear-with-mask-2” in this class.

__init__(regrid_mode='bilinear-2', vicinity_radius=25000.0)[source]

Initialise class

Parameters:
  • regrid_mode (str) – Mode of interpolation in regridding. Valid options are “bilinear-2”, “nearest-2”,”nearest-with-mask-2” and “bilinear-with-mask-2”. The last two options trigger adjustment of regridded points to match source points in terms of land / sea type.

  • vicinity_radius (float) – Radius of vicinity to search for a coastline, in metres.

_abc_impl = <_abc_data object>
process(cube_in, cube_in_mask, cube_out_mask)[source]

Regridding considering land_sea mask. please note cube_in must use lats/lons rectlinear system(GeogCS). cube_in_mask and cube_in could be different resolution. cube_out could be either in lats/lons rectlinear system or LambertAzimuthalEqualArea system. Grid points in cube_out domain but not in cube_in domain will be masked.

Parameters:
  • cube_in (Cube) – Cube of data to be regridded.

  • cube_in_mask (Cube) – Cube of land_binary_mask data ((land:1, sea:0). used to determine where the input model data is representing land and sea points.

  • cube_out_mask (Cube) – Cube of land_binary_mask data on target grid (land:1, sea:0).

Return type:

Cube

Returns:

Regridded result cube.