Photometric filter transmission curves¶
Broad-band photometry is an important tool to study variability and
band transmission curves are, e.g., required to derive photometric fluxes
from spectra. The TransmissionCurves()
class provides access to
photometric transmission curves.
Further information on photometric bands:
Band
Destination
Bessel
Bessel 1990, PASP 102, 1181B (helpful link)
Johnson
Johnson and Morgan 1951, ApJ 114, 522 (helpful link)
Spitzer IRAC
Transmission curves for Spitzer IRAC instrument
Call addSpitzerIRACPassbands to add to passband inventory.
Kepler
Kepler passband (high resolution)
Call addKeplerPassband to add passband to inventory.
TESS
Transmission curve for TESS mission (futher information)
Call addTESSPassband to add passband to inventory.
Gaia (DR3)
Transmission curves (G, G_BP, G_RP) for the Kepler mission (DR3) (further information)
Example of usage¶
from __future__ import print_function
from PyAstronomy import pyasl
import numpy as np
import matplotlib.pylab as plt
# Import six for Python 2/3 compatibility
import six
# Get transmission curve object
tcs = pyasl.TransmissionCurves()
# Add passbands from Spitzer IRAC
tcs.addSpitzerIRACPassbands()
print("Available bands: ", tcs.availableBands())
# Wavelength axis
wvl = np.linspace(3000, 10000, 10000)
# Plot transmission curves for Bessel b, v, and r bands
for (b, c) in six.iteritems({"b": "b", "v": "k", "r": "r"}):
tc = tcs.getTransCurve("Bessel " + b)
trans = tc(wvl)
plt.plot(wvl, trans, c+'-', label="Bessel " + b)
# Plot transmission curves for Johnson U, B, and V bands
for (b, c) in six.iteritems({"U": "m", "B": "b", "V": "k"}):
tc = tcs.getTransCurve("Johnson " + b)
trans = tc(wvl)
plt.plot(wvl, trans, c+'--', label="Johnson " + b)
plt.legend()
plt.xlabel("Wavelength [$\AA$]")
plt.ylabel("Transmission")
plt.show()
# Create Planck spectrum ...
wvl = np.arange(3000., 10000., 1.0)
spec = pyasl.planck(T=5777., lam=wvl*1e-10)
# ... and convolve with Johnson V band
vbs = tcs.convolveWith(wvl, spec, "Johnson V")
plt.plot(wvl, spec, 'b-', label='Input spectrum')
plt.plot(wvl, vbs, 'r--', label='Convolution with Johnson V band')
plt.legend()
plt.show()
API¶
- class PyAstronomy.pyasl.TransmissionCurves(fn='default')¶
Photometric transmission curves for various photometric bands.
A list of supported bands can be obtained by calling availableBands.
- Parameters
- fnstring, optional
The filename of the data file. Default is ‘default’, which means that the shipped data file will be used.
Methods
addKeplerPassband
([forceDownload, verbose])Adds Kepler mission passband.
addPassband
(name, wvl, trans[, snc])Add a new passband to the inventory.
addSpitzerIRACPassbands
([forceDownload, verbose])Adds Spitzer IRAC passbands.
addTESSPassband
([forceDownload, verbose])Adds TESS mission passband.
Band names of available transmission curves.
convolveWith
(wvl, spec, bn[, ik])Convolve spectrum with transmission curve.
getTransCurve
(bn[, ik])Get a transmission curve.
Get data specifying the transmission curve.
- addKeplerPassband(forceDownload=False, verbose=True)¶
Adds Kepler mission passband.
Kepler high-resolution passband is downloaded from: https://keplergo.github.io/KeplerScienceWebsite/data/kepler_response_hires1.txt
and added as ‘Kepler_HR’.
- Parameters
- forceDownloadboolean, optional
If True, a re-download of the passband files is triggered. Default is False.
- verboseboolean, optional
If True (default), download process will print information on progress.
- addPassband(name, wvl, trans, snc=False)¶
Add a new passband to the inventory.
- Parameters
- namestring
The name of the passband.
- wvlarray
Wavelength in A.
- transarray
Transmission of the passband.
- sncboolean, optional
A Skip Name Check flag. If False (default), an exception is raised if the passband name is already present in the inventory of passbands. Otherwise the old passband is replaced by the new specification.
- addSpitzerIRACPassbands(forceDownload=False, verbose=True)¶
Adds Spitzer IRAC passbands.
On first call, the passband files are downloaded. The files are downloaded from:
http://irsa.ipac.caltech.edu/data/SPITZER/docs/irac/calibrationfiles/spectralresponse/
- Parameters
- forceDownloadboolean, optional
If True, a re-download of the passband files is triggered. Default is False.
- verboseboolean, optional
If True (default), download process will print information on progress.
- addTESSPassband(forceDownload=False, verbose=True)¶
Adds TESS mission passband.
TESS passband is downloaded from: https://heasarc.gsfc.nasa.gov/docs/tess/data/tess-response-function-v1.0.csv
and added as ‘TESS’.
- Parameters
- forceDownloadboolean, optional
If True, a re-download of the passband files is triggered. Default is False.
- verboseboolean, optional
If True (default), download process will print information on progress.
- availableBands()¶
Band names of available transmission curves.
- Returns
- Available nameslist of strings
All bands for which data are available.
- convolveWith(wvl, spec, bn, ik='linear')¶
Convolve spectrum with transmission curve.
- Parameters
- wvl, specarrays
Wavelength axis [A] and spectral data.
- bnstring
Name of the band.
- ikstring, optional
The type of interpolation. Accepts all values also accepted by the kind keyword of scipy’s interp1d routine. Default is ‘linear’.
- Returns
- Convolved spectrumarray
Input spectrum multiplied with transmission curve of the specified band.
- getTransCurve(bn, ik='linear')¶
Get a transmission curve.
- Parameters
- bnstring
Name of the band.
- ikstring, optional
The type of interpolation. Accepts all values also accepted by the kind keyword of scipy’s interp1d routine. Default is ‘linear’.
- Returns
- Transmission curvecallable
An object (scipy.interpolate.interp1d) that can be called with wavelength (float or array in [A]) as argument and returns the transmission.
- getTransCurveData(bn)¶
Get data specifying the transmission curve.
- Returns
- Transmission table2d array
A table (array) with wavelength [A] in first column and transmission (0-1) in the second column.