regrid (array-level) with MIR

regrid(data, in_grid=None, out_grid=None, interpolation='linear', backend='mir')

Regrid array data using MIR (Meteorological Interpolation and Regridding).

The backend parameter is set to “mir” by default so it is not necessary to specify it explicitly.

Parameters:
  • data (ndarray) – The data to be regridded, represented as a NumPy array, defining a single field on the in_grid.

  • in_grid (dict, str, Grid) – The gridspec describing the grid that data are defined on. For the list of supported grids, please refer to the gridspec documentation.

  • out_grid (dict, str, Grid) – The gridspec describing the target grid that data will be interpolated onto. For the list of supported grids, please refer to the gridspec documentation.

  • interpolation (str) –

    The interpolation method. Please note not all the interpolation methods support all possible grid types. The possible values are as follows:

    • ”linear”: Finite Element based interpolation with linear base functions with supporting triangular mesh

    • ”grid-box-average”: input/output grid box intersections interpolation preserving input value integrals (conservative interpolation).

    • ”nearest-neighbour”: choose a nearest neighbouring input point to define output point value

Returns:

Return a tuple with the interpolated values and the gridspec of the output grid. This latter might be different than the one specified in out_grid because MIR can perform normalisation and other adjustments on it.

Return type:

tuple of ndarray and dict

Examples