lezargus.library.photometry module#
Functions to deal with the computation of synthetic and real photometry.
- lezargus.library.photometry.calculate_filter_magnitude_vega(star_spectra: hint.LezargusSpectrum, filter_spectra: hint.LezargusSpectrum, filter_zero_point: float, filter_zero_point_uncertainty: float | None = None) tuple[float, float] [source]#
Calculate the Vega-based synthetic magnitude of a star in a filter.
We compute the synthetic magnitude of a star using its spectra, provided the filter transmission. This function is the manual method, where the filters and its properties must be defined manually. An automatic mode is also available, see auto_calculate_filter_magnitude_vega.
- Parameters:
star_spectra (LezargusSpectrum) – The target star that we will compute the synthetic filter magnitude of.
filter_spectra (LezargusSpectrum) – The filter transmission, saved as a spectra container instance. The filter provided must be in the photon counting form. We assume that the wavelength term has already been multiplied through. The variable name is chosen to prevent a name clash with the Python built-in.
filter_zero_point (float) – The zero point value for the provided filter.
filter_zero_point_uncertainty (float, default = None) – The uncertainty on the zero point. If not provided, we assume a zero uncertainty.
- Returns:
magnitude (float) – The computed synthetic magnitude.
uncertainty (float) – The uncertainty in the computed synthetic magnitude.
- lezargus.library.photometry.calculate_filter_zero_point_vega(filter_spectra: hint.LezargusSpectrum, standard_spectra: hint.LezargusSpectrum, standard_filter_magnitude: float, standard_filter_uncertainty: float | None = None) tuple[float, float | None] [source]#
Calculate the magnitude zero point of a filter in the Vega system.
This function computes Vega zero points by integrating it over the filter band pass. To better facilitate this as a library function, the standard spectra and its magnitude may be input. However, for most cases, the Vega spectra in the data collection is good enough.
- Parameters:
filter_spectra (LezargusSpectrum) – The filter transmission, saved as a spectra container instance. The filter provided must be in the photon counting form. We assume that the wavelength term has already been multiplied through. The variable name is chosen to prevent a name clash with the Python built-in.
standard_spectra (LezargusSpectrum) – The standard star, as saved by a spectra container instance.
standard_filter_magnitude (float) – The magnitude of the standard star in that filter.
standard_filter_uncertainty (float, default = None) – The uncertainty in the magnitude of the standard star in that filter. Often this is not needed because the magnitude value of standard defines the filter system anyways and so, by definition, there is no uncertainty.
- Returns:
zero_point (float) – The zero point value.
zero_point_uncertainty (float or None) – The uncertainty on the zero point. If the standard star provided has some uncertainty, or if the filter does, then we attempt to calculate the uncertainty on the value.
- lezargus.library.photometry.calculate_photometric_correction_factor_vega(star_spectra: hint.LezargusSpectrum, filter_spectra: hint.LezargusSpectrum, star_magnitude: float, filter_zero_point: float, star_magnitude_uncertainty: float | None = None, filter_zero_point_uncertainty: float | None = None) tuple[float, float] [source]#
Compute photometric correction factors for Vega-based filters.
We use the definition of the Vega photometric system to try and compute the scaling factor to scale the spectra so that it is spectro-photometrically calibrated.
See [[TODO]] for more information.
- Parameters:
star_spectra (LezargusSpectrum) – The target star that we will compute the synthetic filter magnitude of.
filter_spectra (LezargusSpectrum) – The filter transmission, saved as a spectra container instance. The filter provided must be in the photon counting form. We assume that the wavelength term has already been multiplied through. The variable name is chosen to prevent a name clash with the Python built-in.
star_magnitude (float) – The magnitude of the star in the given filter. We use this value to compute the photometric scale factor.
filter_zero_point (float) – The zero point value for the provided filter.
star_magnitude_uncertainty (float, default = None) – The uncertainty on the star’s magnitude. If not provided, we assume a zero uncertainty.
filter_zero_point_uncertainty (float, default = None) – The uncertainty on the zero point. If not provided, we assume a zero uncertainty.
- Returns:
correction_factor (float) – The correction factor calculated using synthetic photometry.
correction_factor_uncertainty (float) – The uncertainty on the correction factor.