regrid
New in version 0.5.0.
- regrid(values, in_grid=None, out_grid=None, interpolation='linear', output='values_gridspec', backend='precomputed-local', inventory_path=None)
Regrid the
valuesusing precomputed weights stored at a local path.- Parameters:
values (ndarray, fieldlist, field) –
the following input data types are supported:
an ndarray representing a single field defined on the
in_grid. A validin_gridmust be specified.an earthkit-data GRIB fieldlist (requires earthkit-data >= 0.6.0). The input grid is automatically detected from the data (
in_gridis ignored). It only works when theout_gridis a regular latitude-longitude grid.an earthkit-data GRIB field (requires earthkit-data >= 0.6.0). The input grid is automatically detected from the data (
in_gridis ignored). It only works when theout_gridis a regular latitude-longitude grid.
in_grid (dict) – the gridspec describing the grid that
valuesare defined on. Ignored whenvaluesis not an ndarray.out_grid (dict) – the gridspec describing the target grid that
valueswill be interpolated ontointerpolation (str) – the interpolation method. Possible values are
linearandnearest-neighbour. Fornearest-neighbourthe following aliases are also supported:nn,nearest-neighbor.output (str) –
define what is returned when the input is an array, ignored otherwise. Possible values are as follows:
- Returns:
see the
outputparameter for details
The interpolation only works when a pre-computed interpolation weights are available for the given
in_grid,out_gridandinterpolationcombination in the local inventory specified byinventory_path.If the weights are available the interpolation is performed by multiplying the
valuesvector with it (matrix-vector multiplication).