def METHOD_NAME(self, interpolate, wavenumbers):
    """
    Interpolate data to given wavenumbers and extend the possibly
    nan-edges with the nearest values.
    """
    # interpolate reference to the given wavenumbers
    X = interp1d_with_unknowns_numpy(getx(interpolate), interpolate.X, wavenumbers)
    # we know that X is not NaN. same handling of reference as of X
    X, _ = nan_extend_edges_and_interpolate(wavenumbers, X)
    return X