def METHOD_NAME(data, elem_ids, weights=None):
    """Interpolate a single item and time step
    Parameters
    ----------
    data : ndarray
        data to interpolate
    elem_ids : ndarray(int)
        n sized array of 1 or more element ids used for interpolation
    weights : ndarray(float), optional
        weights with same size as elem_ids used for interpolation
    Returns
    -------
    ndarray
        spatially interpolated data
    Notes
    -----
    This function is used internally by interp2d
    """
    if weights is None:
        return data[elem_ids]
    else:
        idat = data[elem_ids] * weights
        return np.sum(idat, axis=1) if weights.ndim == 2 else idat