lezargus.library.container.photometry module#
Photometry filter wrapper class implementation.
An implementation of photometric filters, and all associated functionality is described here. This allows for maximum code reuse when creating all of the filters needed for Lezargus. There are two main types, Vega-based and AB-based.
Moreover, we handle both of the cases for energy-based and photon-counting based forms of photometric filters. See the documentation technical-photometry for more information on energy-based transmission versus photon-counting based forms for more information.
- class lezargus.library.container.photometry.PhotometricABFilter[source]#
Bases:
object
AB/ST system based photometric filter.
- class lezargus.library.container.photometry.PhotometricVegaFilter(wavelength: hint.NDArray, transmission: hint.NDArray, wavelength_unit: hint.Unit | str = 'm')[source]#
Bases:
object
Vega system based photometric filter.
Most of the attributes listed here are the internal ones often used for caching and the like.
- __calculate_zero_point(standard_spectrum: hint.LezargusSpectrum, standard_magnitude: float, standard_magnitude_uncertainty: float = 0) tuple[float, float] #
Calculate the magnitude zero point of this filter in the Vega system.
This function computes Vega zero points by integrating over the filter band pass based on a provided standard spectrum.
- Parameters:
standard_spectrum (LezargusSpectrum) – The standard star, as saved by a spectrum container instance.
standard_magnitude (float) – The magnitude of the standard star in that filter.
standard_magnitude_uncertainty (float, default = 0) – 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; but some systems do want it.
- Returns:
zero_point (float) – The zero point value.
zero_point_uncertainty (float) – 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.
- __init__(wavelength: hint.NDArray, transmission: hint.NDArray, wavelength_unit: hint.Unit | str = 'm') None [source]#
Create an instance of a Vega-based photometric filter.
It may be better to use the class methods
from_energy_transmission()
andfrom_photon_transmission()
instead.- Parameters:
wavelength (NDArray) – The wavelength specification of the photometric filter.
transmission (NDArray) – The filter’s energy-based photometric filter transmission.
wavelength_unit (Unit or string, default = "m") – The unit of the wavelength array.
- Return type:
None
- add_standard_star_spectrum(spectrum: hint.LezargusSpectrum, magnitude: float, magnitude_uncertainty: float) None [source]#
Add a standard star spectrum to characterize the filter system.
A Vega-like standard star, with the filter magnitude (and the uncertainty thereof) characterizes the filter system so that it can be used to determine synthetic magnitudes and scaling factors.
- Parameters:
spectrum (LezargusSpectrum) – The spectrum of the calibrated standard star. As this is a Vega-based filter, the standard star should be appropriate to a Vega system.
magnitude (float) – The magnitude of the standard star for this filter.
magnitude_uncertainty (float) – The uncertainty of the magnitude of the standard star in this filter.
- Return type:
None
- calculate_magnitude(spectrum: hint.LezargusSpectrum) 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 spectrum, provided the filter transmission of this filter.
- Parameters:
spectrum (LezargusSpectrum) – The target star that we will compute the synthetic filter magnitude of.
- Returns:
magnitude (float) – The computed synthetic magnitude.
uncertainty (float) – The uncertainty in the computed synthetic magnitude.
- calculate_photometric_correction(spectrum: hint.LezargusSpectrum, magnitude: float, magnitude_uncertainty: float = 0) tuple[float, float] [source]#
Calculate the photometric correction factor for a spectrum.
We use the definition of the Vega photometric system to try and compute the scaling factor to scale the spectrum so that it is spectro-photometrically calibrated.
See [[TODO]] for more information.
- Parameters:
spectrum (LezargusSpectrum) – The target star spectrum that we will compute the synthetic filter magnitude of.
magnitude (float) – The magnitude of the star in this given filter. We use this value to compute the photometric correction scale factor.
magnitude_uncertainty (float, default = 0) – The uncertainty on the star’s magnitude. If not provided, we assume a zero uncertainty.
- Returns:
factor (float) – The photometric correction factor calculated using synthetic photometry.
factor_uncertainty (float) – The uncertainty on the photometric correction factor.
- classmethod from_energy_transmission(wavelength: hint.NDArray, energy_transmission: hint.NDArray, wavelength_unit: hint.Unit | str = 'm') hint.Self [source]#
Create an instance of the filter via energy transmission.
This function, in essence, is the same as the main initialization function. However, we have it here for consistency.
- Parameters:
wavelength (NDArray) – The wavelength specification of the photometric filter.
energy_transmission (NDArray) – The filter’s energy-based photometric filter transmission.
wavelength_unit (Unit or string, default = "m") – The unit of the wavelength array.
- Return type:
None
- classmethod from_photon_transmission(wavelength: hint.NDArray, photon_transmission: hint.NDArray, wavelength_unit: hint.Unit | str = 'm') hint.Self [source]#
Create an instance of the filter via photon transmission.
- Parameters:
wavelength (NDArray) – The wavelength specification of the photometric filter.
photon_transmission (NDArray) – The filter’s photon-based photometric filter transmission.
wavelength_unit (Unit or string, default = "m") – The unit of the wavelength array.
- Return type:
None
- standard_magnitude: float#
The magnitude of the standard star in this filter.
- standard_magnitude_uncertainty: float#
The uncertainty of the magnitude of the standard star in this filter.
- standard_spectrum: hint.LezargusSpectrum#
The standard star which is the effective dagger standard for this filter. Typically, the standard spectra is a Vega spectra but this may change.
- transmission_energy: hint.NDArray#
The energy-based transmission of the filter at the wavelengths provided.
- transmission_energy_function(wavelength: hint.NDArray) hint.NDArray [source]#
Functional form of the energy-based transmission.
The functional form is just an interpolation of the current values.
- Parameters:
wavelength (NDArray) – The wavelength which we will compute the transmission at.
- Returns:
transmission – The energy-based transmission computed at the provided wavelength.
- Return type:
- property transmission_photon: hint.NDArray#
Compute the photon-based transmission of the filter.
The photon transmission of the filter is computed from the energy transmission.
- Parameters:
None
- Returns:
transmission – The photon-based transmission of the filter.
- Return type:
NDArray
- transmission_photon_function(wavelength: hint.NDArray) hint.NDArray [source]#
Functional form of the photon-based transmission.
The functional form is just an interpolation of the current values.
- Parameters:
wavelength (NDArray) – The wavelength which we will compute the transmission at.
- Returns:
transmission – The photon-based transmission computed at the provided wavelength.
- Return type:
- wavelength: hint.NDArray#
The wavelengths of the energy-based and photon-based transmissions for the filter.
- wavelength_unit: hint.Unit#
The unit of the wavelength. For Lezargus, this is usually meters
- zero_point: float#
The filter zero point value of the filter.
- zero_point_uncertainty: float#
The uncertainty in the filter zero point value of the filter.