reinterpolate_spectrum
- mcalf.utils.spec.reinterpolate_spectrum(spectrum, original_wavelengths, constant_wavelengths)[source]
Reinterpolate the spectrum.
Reinterpolates the spectrum such that intensities at original_wavelengths are transformed into intensities at constant_wavelengths. Uses
scipy.interpolate.InterpolatedUnivariateSpline
to interpolate.- Parameters:
spectrum (numpy.ndarray, ndim=1) – Spectrum to reinterpolate.
original_wavelengths (numpy.ndarray, ndim=1, length=length of spectrum) – Wavelengths of spectrum.
constant_wavelengths (numpy.ndarray, ndim=1) – Wavelengths to cast spectrum into.
- Returns:
spectrum – Reinterpolated spectrum.
- Return type:
numpy.ndarray, length=length of constant_wavelengths