'Interpolation at coordinates
Parameters
xi : ndarray of shape (..., ndim)
The coordinates to sample the gridded data at
method : str
The method of interpolation to perform. Supported are "linear" and
"nearest".'

def __call__(self, xi, method=None):

    method = (self.method if (method is None) else method)
    if (method not in ['linear', 'nearest']):
        raise ValueError(("Method    '%s'    is    not    defined" % method))
    ndim = len(self.grid)
    xi = _ndim_coords_from_arrays(xi, ndim=ndim)
    if (xi.shape[(-1)] != len(self.grid)):
        raise ValueError(('The    requested    sample    points    xi    have    dimension    %d,    but    this    RegularGridInterpolator    has    dimension    %d' % (xi.shape[1], ndim)))
    xi_shape = xi.shape
    xi = xi.reshape((-1), xi_shape[(-1)])
    if self.bounds_error:
        for (i, p) in enumerate(xi.T):
            if (not np.logical_and(np.all((self.grid[i][0] <= p)), np.all((p <= self.grid[i][(-1)])))):
                raise ValueError(('One    of    the    requested    xi    is    out    of    bounds    in    dimension    %d' % i))
    (indices, norm_distances, out_of_bounds) = self._find_indices(xi.T)
    if (method == 'linear'):
        result = self._evaluate_linear(indices, norm_distances, out_of_bounds)
    elif (method == 'nearest'):
        result = self._evaluate_nearest(indices, norm_distances, out_of_bounds)
    if ((not self.bounds_error) and (self.fill_value is not None)):
        result[out_of_bounds] = self.fill_value
    return result.reshape((xi_shape[:(-1)] + self.values.shape[ndim:]))
