interpspec

sofia_redux.spectroscopy.interpspec.interpspec(x, y, xout, error=None, leavenans=False, cval=nan)[source]

Perform a linear interpolation and propagate errors

Points outside the ix range are set to NaN. NaNs are removed from both ix and ox. NaNs are also removed in the y output unless leavenans is set to True.

Parameters:
xarray_like of float

(N,) Independent values of spectrum

yarray_like of float

(N,) Dependent values of spectrum

xoutarray_like of float

(M,) New independent values of spectrum

errorarray_like of float, optional

(N,) Error values of the spectrum to propagate

leavenansbool, optional

If True, leave NaNs in the input spectra

cvalfloat, optional

Value to fill in requested interpolation points outside the data range.

Returns:
numpy.ndarary

(M,) New dependent values of the spectrum