mcalf.utils.spec.normalise_spectrum(spectrum, original_wavelengths=None, constant_wavelengths=None, prefilter_response=None, model=None)[source]

Normalise an individual spectrum to have intensities in range [0, 1].


Not recommended for normalising many spectra in a loop.

  • spectrum (numpy.ndarray, ndim=1) – Spectrum to reinterpolate and normalise.

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

  • constant_wavelengths (numpy.ndarray, ndim=1, optional) – Wavelengths to cast spectrum into.

  • prefilter_response (numpy.ndarray, ndim=1, length=length of constant_wavelengths, optional) – Prefilter response to divide spectrum by.

  • model (child class of mcalf.models.ModelBase, optional) – Model to extract the above parameters from.


spectrum – The normalised spectrum.

Return type:

numpy.ndarray, ndim-1, length=length of constant_wavelengths