def rbfinterp2d(xy_coord, values, xgrid, ygrid, **kwargs):
    """
    Radial basis function interpolation of a sparse (multivariate) array.

    .. _ndarray:\
    https://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.html
    .. _`scipy.interpolate.Rbf`:\
    https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.Rbf.html

    This method wraps the `scipy.interpolate.Rbf`_ class.

    Parameters
    ----------
    xy_coord: ndarray_
        Array of shape (n, 2) containing the coordinates of the data points in
        a 2-dimensional space.
    values: ndarray_
        Array of shape (n) or (n, m) containing the values of the data points,
        where *n* is the number of data points and *m* the number of co-located
        variables. All values in ``values`` are required to be finite.
    xgrid, ygrid: ndarray_
        1-D arrays representing the coordinates of the 2-D output grid.

    Other Parameters
    ----------------
    Any of the parameters from the original `scipy.interpolate.Rbf`_ class.
    {extra_kwargs_doc}

    Returns
    -------
    output_array: ndarray_
        The interpolated field(s) having shape (``ygrid.size``, ``xgrid.size``)
        or (*m*, ``ygrid.size``, ``xgrid.size``).
    """
    deprecated_args = ["rbfunction", "k"]
    deprecated_args = [arg for arg in deprecated_args if arg in list(kwargs.keys())]
    if deprecated_args:
        warnings.warn(
            "rbfinterp2d: The following keyword arguments are deprecated:\n"
            + str(deprecated_args),
            DeprecationWarning,
        )

    if values.ndim == 1:
        kwargs["mode"] = "1-D"
    else:
        kwargs["mode"] = "N-D"

    xgridv, ygridv = np.meshgrid(xgrid, ygrid)
    rbfi = _Rbf_cached(*np.split(xy_coord, xy_coord.shape[1], 1), values, **kwargs)
    output_array = rbfi(xgridv, ygridv)

    return np.moveaxis(output_array, -1, 0).squeeze()
Radial basis function interpolation of a sparse (multivariate) array.

.. _ndarray:\
https://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.html
.. _`scipy.interpolate.Rbf`:\
https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.Rbf.html

This method wraps the `scipy.interpolate.Rbf`_ class.

Parameters
----------
xy_coord: ndarray_
Array of shape (n, 2) containing the coordinates of the data points in
a 2-dimensional space.
values: ndarray_
Array of shape (n) or (n, m) containing the values of the data points,
where *n* is the number of data points and *m* the number of co-located
variables. All values in ``values`` are required to be finite.
xgrid, ygrid: ndarray_
1-D arrays representing the coordinates of the 2-D output grid.

Other Parameters
----------------
Any of the parameters from the original `scipy.interpolate.Rbf`_ class.
{extra_kwargs_doc}

Returns
-------
output_array: ndarray_
The interpolated field(s) having shape (``ygrid.size``, ``xgrid.size``)
or (*m*, ``ygrid.size``, ``xgrid.size``).
pysteps/utils/interpolate.py