Bandpass¶
- class nsb2.core.spectral.Bandpass[source]¶
Bases:
objectWavelength-dependent transmission of an optical passband.
The transmission curve is interpolated with an interpolating cubic spline that evaluates to zero outside the tabulated range, so a Bandpass can be called on any wavelength grid.
- Parameters:
wvl (astropy.units.Quantity) – Wavelength grid of the transmission curve, shape
(W,).transmission (numpy.ndarray) – Dimensionless transmission at each wavelength, shape
(W,).
- Variables:
lam (astropy.units.Quantity) – The tabulated wavelength grid.
trx (numpy.ndarray) – The tabulated transmission values.
max (min,) – Lower and upper edge of the tabulated wavelength range.
Examples
>>> import numpy as np, astropy.units as u >>> bp = Bandpass(np.linspace(400, 600, 5) * u.nm, np.ones(5)) >>> float(bp(np.array([500]) * u.nm)[0]) 1.0
Attributes Summary
Vega zeropoint of this passband.
Methods Summary
__call__(lam)Evaluate the transmission at the given wavelengths.
from_SVO(filter_id[, cache])Construct a Bandpass from the SVO Filter Profile Service.
from_csv(file)Construct a Bandpass from a comma-separated table.
Attributes Documentation
- vegazero¶
Vega zeropoint of this passband.
The band-integrated photon-weighted flux of Vega, computed from the CALSPEC reference spectrum
alpha_lyr_stis_012[Bohlin2014]. It is the denominator of the Vega magnitude system, so a source withvegazero-equal integrated flux has magnitude zero in this band.- Raises:
RuntimeError – If the pinned reference spectrum is no longer available from STScI. See
VEGA_CALSPEC_FILE.- Type:
Methods Documentation
- __call__(lam)[source]¶
Evaluate the transmission at the given wavelengths.
- Parameters:
lam (astropy.units.Quantity) – Wavelengths at which to evaluate the transmission. Converted to the unit of the tabulated grid before evaluation.
- Returns:
Dimensionless transmission, zero outside the tabulated range.
- Return type:
- classmethod from_SVO(filter_id, cache=True)[source]¶
Construct a Bandpass from the SVO Filter Profile Service.
The service [Rodrigo2012], [Rodrigo2020] asks to be acknowledged in publications; see Acknowledgements.
- Parameters:
- Returns:
The requested passband.
- Return type:
Notes
Requires network access on the first call for a given filter.
- classmethod from_csv(file)[source]¶
Construct a Bandpass from a comma-separated table.
The file must have a header row. One column must be named
wvland hold wavelengths in nanometres; the transmission is the product of all remaining columns, which lets separate optical elements (mirror, window, photodetector, …) be tabulated side by side.- Parameters:
file (str or pathlib.Path or file-like) – Anything accepted by
numpy.genfromtxt().- Returns:
The combined passband.
- Return type:
- classmethod __new__(*args, **kwargs)¶