lezargus.library.container.functionality.stitch module#
Stitch spectra, images, and cubes together.
Stitching spectra, images, and cubes consistently, while keeping all of the pitfalls in check, is not trivial. We group these three stitching functions, and the required spin-off functions, here.
- lezargus.library.container.functionality.stitch.calculate_spectra_scale_factor(base_spectrum: hint.LezargusSpectrum, input_spectrum: hint.LezargusSpectrum, bounds: tuple[float, float] = (-inf, inf)) tuple[float, float] [source]#
Find the scale factor to scale one overlapping spectrum to another.
This implementation relies on py:func:lezargus.library.stitch.calculate_spectra_scale_factor
Parameter#
- base_spectrumLezargusSpectrum
The spectrum class for the base spectrum. The units of both spectra should be consistent.
- input_spectrumLezargusSpectrum
The spectrum class for the input spectrum which this scale factor is being calculated for. The units of both spectra should be consistent.
- boundstuple, default = (-np.inf, +np.inf)
An additional set of wavelength bounds to specify the limits of the overlap which we use to determine the scale factor. Format is (minimum, maximum). Must be in the same units as the base and input wavelengths.
- returns:
scale_factor (float) – The scale factor to scale the input data to match the base data.
scale_uncertainty (float) – The uncertainty in the scale factor. This is usually not relevant.