speccor

sofia_redux.spectroscopy.speccor.speccor(stack, fwidth=4, err_stack=None, refspec=None, select=None, window=11, info=None)[source]

Correct a _stack of spectra for shape differences

Returns an array of spectra corrected to the reference spectrum

Parameters:
stackarray_like of (int or float)

(n_spectra, n_wave) array of spectra to be corrected.

fwidth(int or float), optional

FFT filter width

err_stackarray_like of (int or float)

(n_spectra, n_wave) array of errors corresponding to the _stack. If given, the corrected error array is given as a second output.

refspecarray_like of (int or float)

(n_wave,) reference spectrum that the spectra in the _stack are corrected to.

selectarray_like of (int or bool)

(n_spectra,) array denoting which spectra to use to determine the reference spectrum. However, all the spectra in the _stack are scaled to the reference spectrum (True = good, False = bad).

windowint, optional

Positive odd integer defining the width of the Savitzky-Golay used to smooth each spectra before FFT.

infodict, optional

If supplied will be updated with mask and corrections

Returns:
numpy.ndarray or (numpy.ndarray, numpy.ndarray)

(n_spectra, n_wave) array of spectra corrected to the reference spectrum. If err_stack is supplied, it will be returned as a second array.