reinterpolate_spectrum

mcalf.utils.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 (ndarray of ndim=1) – Spectrum to reinterpolate.

  • original_wavelengths (ndarray of ndim=1, length=length of spectrum) – Wavelengths of spectrum.

  • constant_wavelengths (ndarray of ndim=1) – Wavelengths to cast spectrum into.

Returns

spectrum – Reinterpolated spectrum.

Return type

ndarray, length=length of constant_wavelengths