The SKIRT project
advanced radiative transfer for astrophysics
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
pts.band.broadband.BroadBand Class Reference

An instance of the BroadBand class represents either a built-in standard broadband filter (including transmission curve data), a uniform filter over a specified wavelength range (with a constant transmission curve in that range), or a custom filter based on a given wavelength grid and transmission curve. More...

Public Member Functions

def __init__ (self, bandspec)
 The constructor creates a BroadBand instance in one of the following three ways, depending on the type of the bandspec argument: More...
 
def builtinBandNames (cls)
 This function returns an iterable over all built-in band names, in arbitrary order. More...
 
def convolve (self, wavelengths, fluxes, *numWavelengths=None, flavor=None)
 This function calculates and returns the band-averaged value \(\left<F_\lambda\right>\) for a given spectral energy distribution \(F_\lambda(\lambda)\). More...
 
def effectiveWidth (self)
 This function returns the effective band width (a wavelength interval) as defined in the class header as an astropy quantity in micron. More...
 
def maxWavelength (self)
 This function returns the maximum wavelength for the band, as an astropy quantity in micron. More...
 
def minWavelength (self)
 This function returns the minimum wavelength for the band, as an astropy quantity in micron. More...
 
def name (self)
 This function returns the band's name, i.e. More...
 
def pivotWavelength (self)
 This function returns the pivot wavelength as defined in the class header, as an astropy quantity in micron. More...
 
def transmissionCurve (self)
 This function returns a tuple containing a copy of the wavelength and transmission arrays representing the transmission curve for this band. More...
 
def wavelengthRange (self)
 This function returns a tuple of astropy quantities specifying the wavelength range for this band in micron. More...
 

Private Member Functions

def _bandNameFromSpec (self, bandspec)
 This function matches the given band specification with all built-in band names, i.e. More...
 
def _loadALMA (self)
 This function loads the transmission curve for the ALMA format. More...
 
def _loadEUCLID (self)
 This function loads the transmission curve for the EUCLID format. More...
 
def _loadJCMT (self)
 This function loads the transmission curve for the JCMT format. More...
 
def _loadPLANCK (self)
 This function loads the transmission curve for the PLANCK format. More...
 
def _loadSVO (self)
 This function loads the transmission curve for the SVO format. More...
 
def _normalize (self)
 This function normalizes the transmission curve after it has been loaded during construction, and attaches the appropriate astropy units (micron and 1/micron, respectively) It expects _bandname, _wavelengths, _transmissions, and _photoncounter to be set. More...
 

Private Attributes

 _bandname
 
 _photoncounter
 
 _transmissions
 
 _wavelengths
 

Static Private Attributes

dictionary _bandinfo
 The band information dictionary described in the class header. More...
 

Detailed Description

An instance of the BroadBand class represents either a built-in standard broadband filter (including transmission curve data), a uniform filter over a specified wavelength range (with a constant transmission curve in that range), or a custom filter based on a given wavelength grid and transmission curve.

Refer to the constructor of this class for information on how to construct one of these two types of BroadBand objects.

Band properties and operations

This class offers operations such as determining the band's pivot wavelength and convolving an SED or a frame data cube with the band's transmission curve.

Refer to the appendix in Camps et al. 2016 (MNRAS 462, 1057-1075) for a brief introduction of the relevant concepts and a derivation of the corresponding formulas. For the purposes of this class, a band is defined through its arbitrarily scaled transmission curve \(T(\lambda)\). The relative transmission at a given wavelength can then be written as

\[ T_\text{rel}(\lambda) = \frac{ T(\lambda) } { \max[ T(\lambda) ] }. \]

Given a spectral energy distribution \(L_\lambda(\lambda)\), the mean specific luminosity over the band \(\left<L_\lambda\right>\) can then be obtained through

\[ \left<L_\lambda\right> = \frac{ \int L_\lambda(\lambda)T(\lambda) \,\mathrm{d}\lambda } { \int T(\lambda) \,\mathrm{d}\lambda }. \]

The pivot wavelength of the band is defined as the wavelength at which the mean specific luminosity can be properly converted between wavelength and frequency representations. It is given by

\[ \lambda_\mathrm{pivot} = \sqrt{ \frac{ \int T(\lambda) \,\mathrm{d}\lambda } { \int T(\lambda) \,\mathrm{d}\lambda/\lambda^2 } }. \]

The effective width of the band is defined as the horizontal size of a rectangle with height equal to the maximum transmission and with the same area as the one covered by the band's transmission curve. It is given by

\[ W_\mathrm{eff} = \frac{ \int T(\lambda) \,\mathrm{d}\lambda } { \max[ T(\lambda) ] }. \]

As set forth by Camps et al. 2016, for energy measuring devices (bolometers) the total system transmission \(T(\lambda)\) is usually given by the instrument designers, and it can be used directly for this class. For photon counters (including all instruments in the UV, optical and near infrared), the total system response \(R(\lambda)\) is usually given instead. The transmission curve needed for this class can be derived from the response curve through

\[ T(\lambda) = \lambda\,R(\lambda). \]

When applicable, this operation is performed by the constructor just after loading the response curve data from file.

Also, to further simplify the above formulas, the constructor normalizes the transmission curve to unity, i.e.

\[ \int T(\lambda) \,\mathrm{d}\lambda = 1. \]

Built-in bands

The table below lists the built-in bands available at the time of writing. The first column lists the complete band name; the second column indicates the corresponding pivot wavelength.

Band name Pivot wavelength (micron)
2MASS_2MASS_J 1.2393
2MASS_2MASS_H 1.6495
2MASS_2MASS_KS 2.1639
ALMA_ALMA_10 349.89
ALMA_ALMA_9 456.2
ALMA_ALMA_8 689.59
ALMA_ALMA_7 937.98
ALMA_ALMA_6 1244.4
ALMA_ALMA_5 1616
ALMA_ALMA_4 2100.2
ALMA_ALMA_3 3043.4
EUCLID_VIS_VIS 0.71032
EUCLID_NISP_Y 1.0808
EUCLID_NISP_J 1.3644
EUCLID_NISP_H 1.7696
GALEX_GALEX_FUV 0.15351
GALEX_GALEX_NUV 0.23008
GENERIC_JOHNSON_U 0.35247
GENERIC_JOHNSON_B 0.44169
GENERIC_JOHNSON_V 0.55251
GENERIC_JOHNSON_R 0.6899
GENERIC_JOHNSON_I 0.8739
GENERIC_JOHNSON_J 1.2431
GENERIC_JOHNSON_M 5.0122
HERSCHEL_PACS_70 70.77
HERSCHEL_PACS_100 100.8
HERSCHEL_PACS_160 161.89
HERSCHEL_SPIRE_250 252.55
HERSCHEL_SPIRE_350 354.27
HERSCHEL_SPIRE_500 515.35
IRAS_IRAS_12 11.41
IRAS_IRAS_25 23.609
IRAS_IRAS_60 60.409
IRAS_IRAS_100 101.14
JCMT_SCUBA2_450 449.3
JCMT_SCUBA2_850 853.81
PLANCK_HFI_857 352.42
PLANCK_HFI_545 545.55
PLANCK_HFI_353 839.3
PLANCK_HFI_217 1367.6
PLANCK_HFI_143 2130.7
PLANCK_HFI_100 3001.1
PLANCK_LFI_70 4303
PLANCK_LFI_44 6845.9
PLANCK_LFI_30 10674
RUBIN_LSST_U 0.368
RUBIN_LSST_G 0.47823
RUBIN_LSST_R 0.62178
RUBIN_LSST_I 0.75323
RUBIN_LSST_Z 0.86851
RUBIN_LSST_Y 0.97301
SLOAN_SDSS_U 0.35565
SLOAN_SDSS_G 0.47025
SLOAN_SDSS_R 0.61756
SLOAN_SDSS_I 0.749
SLOAN_SDSS_Z 0.89467
SPITZER_IRAC_I1 3.5508
SPITZER_IRAC_I2 4.496
SPITZER_IRAC_I3 5.7245
SPITZER_IRAC_I4 7.8842
SPITZER_MIPS_24 23.759
SPITZER_MIPS_70 71.985
SPITZER_MIPS_160 156.43
SWIFT_UVOT_UVW2 0.20552
SWIFT_UVOT_UVM2 0.22462
SWIFT_UVOT_UVW1 0.25804
SWIFT_UVOT_U 0.34628
SWIFT_UVOT_B 0.43496
SWIFT_UVOT_V 0.54254
TNG_OIG_U 0.37333
TNG_OIG_B 0.43978
TNG_OIG_V 0.53729
TNG_OIG_R 0.63902
TNG_NICS_J 1.2758
TNG_NICS_H 1.6265
TNG_NICS_K 2.2016
UKIRT_UKIDSS_Z 0.88264
UKIRT_UKIDSS_Y 1.0314
UKIRT_UKIDSS_J 1.2501
UKIRT_UKIDSS_H 1.6354
UKIRT_UKIDSS_K 2.2058
WISE_WISE_W1 3.3897
WISE_WISE_W2 4.6406
WISE_WISE_W3 12.568
WISE_WISE_W4 22.314

Built-in band implementation

The hard-coded class dictionary _bandinfo maps the band name for all built-in bands to the information needed to load the corresponding transmission curve. The value tuple includes the following items:

SVO

The band descriptions in the SVO directory were downloaded from the SVO filter profile service web site http://svo2.cab.inta-csic.es/theory/fps in XML format.

The last item of the value tuple in the _bandinfo dictionary is a Boolean flag indicating the type of instrument (because this information cannot be derived from the SVO file contents): the flag is True for photon counters and False for bolometers.

JCMT

The transmission curves for the SCUBA-2 450 and 850 micron instruments on the JCMT telescope were converted to a simple text column format from 'model450' and 'model850' data downloaded at http://www.eaobservatory.org/jcmt/instrumentation/continuum/scuba-2/filters/

The JCMT instruments are bolometers.

PLANCK

The PLANCK transmission curves are provided as a text column file for each of the following bands:

Band name Frequency (GHz) Wavelength (micron)
LFI 030 28 10600
LFI 044 44 6810
LFI 070 70 4260
HFI 100 100 3000
HFI 143 142 2100
HFI 217 222 1380
HFI 353 352 850
HFI 545 545 550
HFI 857 857 350

The PLANCK instruments are bolometers.

ALMA

The ALMA transmission curves are provided as a single text column file for all bands. ALMA sensitivity depends on the amount of water in the atmosphere, quantified by the precipitable water vapour (pwv) in mm. However, because we use only transmission curves normalized in each band, the effect of the pwv is minimal for our purposes. Somewhat arbitrarily, we opted to use the data for pwv = 0.2 mm.

The ALMA instruments are bolometers.

The last item of the value tuple in the _bandinfo dictionary specifies the wavelength range for each ALMA band supported here, so that we can select the appropriate portion of the transmission curve (provdided in a single file).

ALMA BAND Frequency range (GHz) Wavelength range (mm) Wavelength range (micron)
1 31 - 45 unsupported unsupported
2 67 - 90 unsupported unsupported
3 84 - 116 3.57 - 2.59 2590 - 3570
4 125 - 163 2.40 - 1.84 1840 - 2400
5 162 - 211 1.84 - 1.42 1420 - 1840
6 211 - 275 1.42 - 1.09 1090 - 1420
7 275 - 373 1.09 - 0.80 800 - 1090
8 385 - 500 0.78 - 0.60 600 - 780
9 602 - 720 0.50 - 0.42 420 - 500
10 787 - 950 0.38 - 0.32 320 - 380

EUCLID and RUBIN

The Euclid and Rubin response curves are provided as simple text column files with wavelength in Angstrom. Some files include a lot of leading and/or trailing wavelength points with zero or very small transmission; our load function removes these points.

All Euclid and Rubin instruments are photon counters.

Constructor & Destructor Documentation

◆ __init__()

def pts.band.broadband.BroadBand.__init__ (   self,
  bandspec 
)

The constructor creates a BroadBand instance in one of the following three ways, depending on the type of the bandspec argument:

  • if bandspec is a string, it looks for a built-in standard broadband filter based on the text segments in the string, and then loads the corresponding transmission curve from built-in resources (residing in this package's data directory). To specify a band, it suffices to include just two segments of its name (case insensitive) that uniquely identify the band, seperated by an underscore or a space. For example, to select the HERSCHEL_PACS_100 band, one could enter "Herschel 100", "PACS 100", or "HERSCHEL_PACS_100".
  • if bandspec is a tuple with two numbers, a bolometer-type band is constructed with a uniform transmission curve in the indicated (min,max) wavelength range (expressed in micron).
  • if bandspec is a two-dimensional numpy.ndarray, a bolometer-type band is constructed using bandspec[:,0] as wavelength grid and bandspec[:,1] as transmission curve. The wavelengths are assumed to be expressed in micron, while the transmission curves are assumed dimensionless. The array layout used here is identical to what one would obtain when applying numpy.loadtxt() to the input file for a SKIRT FileBand.

If bandspec has a different type, or if its string contents does not unambiguously match a built-in band name, the constructor raises an exception.

Note
During the first part of construction, _wavelengths are initialized in micron but without explicit units, and _transmissions have arbitrary scale. Thus, these are plain numpy arrays, not astropy quantities. At the end of construction, the _normalize() function attaches the appropriate units.

Member Function Documentation

◆ _bandNameFromSpec()

def pts.band.broadband.BroadBand._bandNameFromSpec (   self,
  bandspec 
)
private

This function matches the given band specification with all built-in band names, i.e.

the keys of the _bandinfo dictionary. If there is a single match, the corresponding key is returned. If there is no match, or if there are multiple matches, an exception is raised. To match a band name, a band specification must include just two segments of the band name (case insensitive). On both sides of the match, segments are separated by whitespace and/or underscores.

◆ _loadALMA()

def pts.band.broadband.BroadBand._loadALMA (   self)
private

This function loads the transmission curve for the ALMA format.

It expects _bandname to be set, and it sets _wavelengths, _transmissions, and _photoncounter.

◆ _loadEUCLID()

def pts.band.broadband.BroadBand._loadEUCLID (   self)
private

This function loads the transmission curve for the EUCLID format.

It expects _bandname to be set, and it sets _wavelengths, _transmissions, and _photoncounter.

◆ _loadJCMT()

def pts.band.broadband.BroadBand._loadJCMT (   self)
private

This function loads the transmission curve for the JCMT format.

It expects _bandname to be set, and it sets _wavelengths, _transmissions, and _photoncounter.

◆ _loadPLANCK()

def pts.band.broadband.BroadBand._loadPLANCK (   self)
private

This function loads the transmission curve for the PLANCK format.

It expects _bandname to be set, and it sets _wavelengths, _transmissions, and _photoncounter.

◆ _loadSVO()

def pts.band.broadband.BroadBand._loadSVO (   self)
private

This function loads the transmission curve for the SVO format.

It expects _bandname to be set, and it sets _wavelengths, _transmissions, and _photoncounter.

◆ _normalize()

def pts.band.broadband.BroadBand._normalize (   self)
private

This function normalizes the transmission curve after it has been loaded during construction, and attaches the appropriate astropy units (micron and 1/micron, respectively) It expects _bandname, _wavelengths, _transmissions, and _photoncounter to be set.

◆ builtinBandNames()

def pts.band.broadband.BroadBand.builtinBandNames (   cls)

This function returns an iterable over all built-in band names, in arbitrary order.

◆ convolve()

def pts.band.broadband.BroadBand.convolve (   self,
  wavelengths,
  fluxes,
numWavelengths = None,
  flavor = None 
)

This function calculates and returns the band-averaged value \(\left<F_\lambda\right>\) for a given spectral energy distribution \(F_\lambda(\lambda)\).

For a band with transmission curve \(T(\lambda)\),

\[ \left<F_\lambda\right> = \frac{ \int F_\lambda(\lambda)T(\lambda) \,\mathrm{d}\lambda } { \int T(\lambda) \,\mathrm{d}\lambda }. \]

The function in fact accepts a distribution (over a range of wavelengths) of various spectral quantities, including flux density, surface brightness, spectral radiance, or spectral luminosity of any "flavor" (neutral, per wavelength, or per frequency) and in arbitrary units. For the purposes of this function, these quantities are generically referred to as "flux". The incoming fluxes are converted to an equivalent "per-wavelength" flavor, the convolution is calculated according to the equation above, and the result is converted back to the flavor and units of the incoming fluxes, or to the optionally specified flavor and/or units.

The function accepts the following arguments:

  • wavelengths: an astropy quantity array specifying the wavelengths \(\lambda_\ell\), in increasing order, on which the fluxes are sampled. The convolution is performed on a wavelength grid that combines the grid points given here with the grid points on which the band transmission curve is defined.
  • fluxes: an astropy quantity array specifying the flux distribution(s) \(F_\lambda(\lambda_\ell)\). This can be an array with the same length as wavelengths, or a multi-dimensional array where the last dimension has the same length as wavelengths. The returned result will have the shape of fluxes minus the last (or only) dimension.
  • numWavelengths: an integer specifying the approximate number of wavelength grid points used in the convolution calculation, or None (or omitted) to indicate no limit. The incoming flux distribution is resampled to all wavelength points in the combined convolution grid. Convolving large data cubes may thus consume a prohibitive amount of memory and/or computation time unless the number of wavelengths is limited.
  • flavor: the flavor and/or units to which the result must be converted. If missing or None, the result is converted back to the flavor and units of the incoming fluxes. If specified, this can be one of the strings "neutral", "wavelength", or "frequency", or an explicit astropy unit instance that is compatible with the incoming flux type (density, brightness, luminosity), after flavor conversion.

◆ effectiveWidth()

def pts.band.broadband.BroadBand.effectiveWidth (   self)

This function returns the effective band width (a wavelength interval) as defined in the class header as an astropy quantity in micron.

◆ maxWavelength()

def pts.band.broadband.BroadBand.maxWavelength (   self)

This function returns the maximum wavelength for the band, as an astropy quantity in micron.

◆ minWavelength()

def pts.band.broadband.BroadBand.minWavelength (   self)

This function returns the minimum wavelength for the band, as an astropy quantity in micron.

◆ name()

def pts.band.broadband.BroadBand.name (   self)

This function returns the band's name, i.e.

one of the keys of the _bandinfo dictionary, or "Uniform" for uniform bands.

◆ pivotWavelength()

def pts.band.broadband.BroadBand.pivotWavelength (   self)

This function returns the pivot wavelength as defined in the class header, as an astropy quantity in micron.

Note
The implementation here does purposefully not use a call to numpy.trapz() to exactly reproduce the numerical quadrature rule implemented in the Band class in SKIRT. This to avoid significant differences in pivot wavelength for a uniform band consisting of only two wavelength points. Both the implementation here and in SKIRT are bad approximations for the real pivot wavelength in this case, but at least they will be the same, which is important when identifying bands in SKIRT output.

◆ transmissionCurve()

def pts.band.broadband.BroadBand.transmissionCurve (   self)

This function returns a tuple containing a copy of the wavelength and transmission arrays representing the transmission curve for this band.

For photon counters the response curve has already been converted to a transmission curve as described in the class header. Both arrays are astropy quantities. The wavelengths are in micron and the transmissions in 1/micron (because of the normalization to unity).

◆ wavelengthRange()

def pts.band.broadband.BroadBand.wavelengthRange (   self)

This function returns a tuple of astropy quantities specifying the wavelength range for this band in micron.

The transmission may be zero in some (usually small) intervals within the range, but it is guaranteed to be zero outside the range.

Member Data Documentation

◆ _bandinfo

dictionary pts.band.broadband.BroadBand._bandinfo
staticprivate

The band information dictionary described in the class header.


The documentation for this class was generated from the following file: