regrid (array-level) with MIR¶
- regrid(data, in_grid=None, out_grid=None, interpolation='linear', backend='mir')
Regrid array
datausing MIR (Meteorological Interpolation and Regridding).The
backendparameter 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 thatdataare 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 thatdatawill 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_gridbecause MIR can perform normalisation and other adjustments on it.- Return type:
tuple of ndarray and dict