Unit Aware Filter. input spectra and output values have units to avoid mis-interpretation. More...
#include <filter.hpp>
Public Member Functions | |
| Filter (const DMatrix &wavelength, const DMatrix &transmission, const QLength &wavelength_unit, const std::string dtype, const std::string name) | |
| Construct a new Filter:: Filter object. More... | |
| void | info () |
| Display some information on cout. More... | |
| std::string | get_name () |
| double | get_norm () |
| the norm of the passband More... | |
| QLength | get_leff () |
| Effective wavelength. More... | |
| QLength | get_lphot () |
| Photon distribution based effective wavelength. More... | |
| QLength | get_fwhm () |
| the difference between the two wavelengths for which filter transmission is half maximum. More... | |
| QLength | get_width () |
| Effective width. More... | |
| QLength | get_lmax () |
| the last λ value with a transmission at least 1% of maximum transmission More... | |
| QLength | get_lmin () |
| the first λ value with a transmission at least 1% of maximum transmission More... | |
| QLength | get_lpivot () |
| Pivot wavelength in nm. More... | |
| QLength | get_cl () |
| Central wavelength. More... | |
| double | get_AB_zero_mag () |
| AB magnitude zero point. More... | |
| QSpectralFluxDensity | get_AB_zero_flux () |
| AB flux zero point. More... | |
| QSpectralFluxDensity | get_AB_zero_Jy () |
| AB flux zero point in Jansky (Jy) More... | |
| double | get_ST_zero_mag () |
| ST magnitude zero point. More... | |
| QSpectralFluxDensity | get_ST_zero_flux () |
| ST flux zero point. More... | |
| QSpectralFluxDensity | get_ST_zero_Jy () |
| ST flux zero point in Jansky (Jy) More... | |
| double | get_Vega_zero_mag () |
| Vega magnitude zero point. More... | |
| QSpectralFluxDensity | get_Vega_zero_flux () |
| Vega flux zero point. More... | |
| QSpectralFluxDensity | get_Vega_zero_Jy () |
| Vega flux zero point in Jansky (Jy) More... | |
| DMatrix | get_wavelength () |
| Get the wavelength in nm. More... | |
| DMatrix | get_wavelength (const QLength &in) |
| Get the wavelength in requested units. More... | |
| DMatrix | get_transmission () |
| Get the transmission. More... | |
| bool | is_photon_type () |
| Check the type of the detector. More... | |
| QSpectralFluxDensity | get_flux (const DMatrix &wavelength, const DMatrix &flux, const QLength &wavelength_unit, const QSpectralFluxDensity &flux_unit) |
| Integrate the flux within the filter and return the integrated energy/flux. More... | |
| Filter | reinterp (const DMatrix &new_wavelength_nm) |
| New filter interpolated to match a wavelegnth definition. More... | |
| Filter | reinterp (const DMatrix &new_wavelength, const QLength &new_wavelength_unit) |
| New filter interpolated to match a wavelegnth definition. More... | |
Unit Aware Filter. input spectra and output values have units to avoid mis-interpretation.
Define a filter by its name, wavelength and transmission The type of detector (energy or photon counter) can be specified for adapting calculations. (default: photon)
Definition at line 43 of file filter.hpp.
| cphot::Filter::Filter | ( | const DMatrix & | wavelength, |
| const DMatrix & | transmission, | ||
| const QLength & | wavelength_unit, | ||
| const std::string | dtype, | ||
| const std::string | name | ||
| ) |
Construct a new Filter:: Filter object.
| wavelength | wavelength definition |
| transmission | transmission on the wavelength |
| wavelength_unit | units of the wavelength definition |
| dtype | "photon" or "energy" |
| name | name of the passband |
| std::runtime_error | if detector type is invalid |
Definition at line 138 of file filter.hpp.
| QSpectralFluxDensity cphot::Filter::get_AB_zero_flux | ( | ) |
AB flux zero point.
Calculated as
\[ flux_{AB} = 10^{-0.4 * (mag_{AB})} \]
Definition at line 281 of file filter.hpp.
| QSpectralFluxDensity cphot::Filter::get_AB_zero_Jy | ( | ) |
AB flux zero point in Jansky (Jy)
Calculated as
\[ flux_{Jy} = \frac{10^5}{10^{-8} c } \lambda_{pivot}^2 flux_{AB} \]
where \(c\) is speed of light in m/s, and \(\lambda_{pivot}\) is the pivot wavelength in angstrom, and \(flux_{AB}\) is the AB flux in flam.
Definition at line 295 of file filter.hpp.
| double cphot::Filter::get_AB_zero_mag | ( | ) |
AB magnitude zero point.
\[ mag_{AB} = -2.5 * log10(f_nu) - 48.60 = -2.5 \log_{10}(f_\lambda) - 2.5 * \log_{10}(\lambda_{pivot}^2 / c) - 48.60 \]
Definition at line 266 of file filter.hpp.
| QLength cphot::Filter::get_cl | ( | ) |
Central wavelength.
\[ \lambda_{cl} = \frac{\int \lambda T(\lambda) d\lambda}{\int T(\lambda) d\lambda}\]
Definition at line 504 of file filter.hpp.
| QSpectralFluxDensity cphot::Filter::get_flux | ( | const DMatrix & | wavelength, |
| const DMatrix & | flux, | ||
| const QLength & | wavelength_unit, | ||
| const QSpectralFluxDensity & | flux_unit | ||
| ) |
Integrate the flux within the filter and return the integrated energy/flux.
The filter is first interpolated on the spectrum wavelength definition. The flux is then calculated as the integral of the flux within the filter depending on the detector type as:
\[ f_\lambda = \frac{\int \lambda T(\lambda) f_\lambda d\lambda}{\int \lambda T(\lambda) d\lambda} \]
\[ f_\lambda = \frac{\int T(\lambda) f_\lambda d\lambda}{\int T(\lambda) d\lambda} \]
| wavelength | wavelength array |
| flux | flux array |
| wavelength_unit | wavelength unit |
| flux_unit | flux unit |
Definition at line 402 of file filter.hpp.
| QLength cphot::Filter::get_fwhm | ( | ) |
the difference between the two wavelengths for which filter transmission is half maximum.
..note:: This calculation is not exact but rounded to the nearest passband data points
Definition at line 561 of file filter.hpp.
| QLength cphot::Filter::get_leff | ( | ) |
Effective wavelength.
\[ \lambda_{eff} = \frac{\int \lambda T(\lambda) Vega(\lambda) d\lambda)}{\int T(\lambda) Vega(\lambda) d\lambda)} \]
Definition at line 580 of file filter.hpp.
| QLength cphot::Filter::get_lmax | ( | ) |
the last λ value with a transmission at least 1% of maximum transmission
Definition at line 531 of file filter.hpp.
| QLength cphot::Filter::get_lmin | ( | ) |
the first λ value with a transmission at least 1% of maximum transmission
Definition at line 524 of file filter.hpp.
| QLength cphot::Filter::get_lphot | ( | ) |
Photon distribution based effective wavelength.
Defined as
\[ \lambda_{phot} = \frac{\int\lambda^2 T(\lambda) Vega(\lambda) d\lambda }{\int\lambda T(\lambda) Vega(\lambda) d\lambda} \]
Definition at line 571 of file filter.hpp.
| QLength cphot::Filter::get_lpivot | ( | ) |
Pivot wavelength in nm.
if photon detector:
\[ \lambda_p^2 = \frac{\int \lambda T(\lambda) d\lambda}{\int T(\lambda) d\lambda / \lambda} \]
if energy:
\[ \lambda_p^2 = \frac{\int T(\lambda) d\lambda}{\int T(\lambda) d\lambda / \lambda^2} \]
Definition at line 517 of file filter.hpp.
|
inline |
Definition at line 89 of file filter.hpp.
| double cphot::Filter::get_norm | ( | ) |
the norm of the passband
\[ norm = \int T(\lambda) d\lambda \]
Definition at line 540 of file filter.hpp.
| QSpectralFluxDensity cphot::Filter::get_ST_zero_flux | ( | ) |
ST flux zero point.
Calculated as
\[ flux_{ST} = 10^{-0.4 * (mag_{ST})} \]
Definition at line 320 of file filter.hpp.
| QSpectralFluxDensity cphot::Filter::get_ST_zero_Jy | ( | ) |
ST flux zero point in Jansky (Jy)
Calculated as
\[ flux_{Jy} = \frac{10^5}{10^{-8} c } \lambda_{pivot}^2 flux_{ST} \]
where \(c\) is speed of light in m/s, and \(\lambda_{pivot}\) is the pivot wavelength in angstrom, and \(flux_{ST}\) is the ST flux in flam.
Definition at line 334 of file filter.hpp.
| double cphot::Filter::get_ST_zero_mag | ( | ) |
ST magnitude zero point.
Set by definition to 21.1 mag
Definition at line 308 of file filter.hpp.
| DMatrix cphot::Filter::get_transmission | ( | ) |
| QSpectralFluxDensity cphot::Filter::get_Vega_zero_flux | ( | ) |
Vega flux zero point.
Definition at line 354 of file filter.hpp.
| QSpectralFluxDensity cphot::Filter::get_Vega_zero_Jy | ( | ) |
Vega flux zero point in Jansky (Jy)
Calculated as
\[ flux_{Jy} = \frac{10^5}{10^{-8} c } \lambda_{pivot}^2 flux_{Vega} \]
where \(c\) is speed of light in m/s, and \(\lambda_{pivot}\) is the pivot wavelength in angstrom, and \(flux_{Vega}\) is the Vega flux in flam.
Definition at line 373 of file filter.hpp.
| double cphot::Filter::get_Vega_zero_mag | ( | ) |
Vega magnitude zero point.
Definition at line 345 of file filter.hpp.
| DMatrix cphot::Filter::get_wavelength | ( | ) |
| DMatrix cphot::Filter::get_wavelength | ( | const QLength & | in | ) |
Get the wavelength in requested units.
| in | units to convert to |
Definition at line 597 of file filter.hpp.
| QLength cphot::Filter::get_width | ( | ) |
Effective width.
\[ width = \frac{\int T(\lambda) d\lambda}{\max(T(\lambda))} \]
Definition at line 549 of file filter.hpp.
| void cphot::Filter::info | ( | ) |
Display some information on cout.
Definition at line 467 of file filter.hpp.
| bool cphot::Filter::is_photon_type | ( | ) |
Check the type of the detector.
Definition at line 616 of file filter.hpp.
| Filter cphot::Filter::reinterp | ( | const DMatrix & | new_wavelength, |
| const QLength & | new_wavelength_unit | ||
| ) |
New filter interpolated to match a wavelegnth definition.
| new_wavelength | wavelength definition |
| new_wavelength_unit | wavelength unit |
Definition at line 456 of file filter.hpp.
New filter interpolated to match a wavelegnth definition.
| new_wavelength_nm | wavelength definition in nm |
Definition at line 442 of file filter.hpp.