getspecscale

sofia_redux.spectroscopy.getspecscale.getspecscale(stack, refidx=None)[source]

Determines the scale factors for a _stack of spectra

Returns an array of scale factors which when multiplied into each spectrum, produces a spectrum whose flux level is about that of the median of all the spectra. If refidx is given, then the spectra are scaled to the spectrum _stack.

Parameters:
stackarray_like of (int or float)

(n_spectra, n_wave) An array of spectra from which to determine scale factors.

refidxint, optional

If supplied, the _stack is scaled to the flux level of this spectrum.

Returns:
numpy.ndarray of float

(n_spectra,) array of scale factors