class sncosmo.Bandpass(wave, trans, wave_unit=Unit('Angstrom'), trans_unit=Unit(dimensionless), normalize=False, name=None, trim_level=None)[source]

Transmission as a function of spectral wavelength.


Wavelength. Monotonically increasing values.


Transmission fraction.

wave_unitUnit or str, optional

Wavelength unit. Default is Angstroms.

trans_unitUnit, optional

Transmission unit. Can be dimensionless_unscaled, indicating a ratio of transmitted to incident photons, or units proportional to inverse energy, indicating a ratio of transmitted photons to incident energy. Default is ratio of transmitted to incident photons.

normalizebool, optional

If True, normalize fractional transmission to be 1.0 at peak. It is recommended to set normalize=True if transmission is in units of inverse energy. (When transmission is given in these units, the absolute value is usually not significant; normalizing gives more reasonable transmission values.) Default is False.

trim_levelfloat, optional

If given, crop bandpass to region where transmission is above this fraction of the maximum transmission. For example, if maximum transmission is 0.5, trim_level=0.001 will remove regions where transmission is below 0.0005. Only contiguous regions on the sides of the bandpass are removed.

namestr, optional

Identifier. Default is None.


Construct a Bandpass and access the input arrays:

>>> b = Bandpass([4000., 4200., 4400.], [0.5, 1.0, 0.5])
>>> b.wave
array([ 4000.,  4200.,  4400.])
>>> b.trans
array([ 0.5,  1. ,  0.5])

Bandpasses act like continuous 1-d functions (linear interpolation is used):

>>> b([4100., 4300.])
array([ 0.75,  0.75])

The effective (transmission-weighted) wavelength is a property:

>>> b.wave_eff

The trim_level keyword can be used to remove “out-of-band” transmission upon construction. The following example removes regions of the bandpass with tranmission less than 1 percent of peak:

>>> band = Bandpass([4000., 4100., 4200., 4300., 4400., 4500.],
...                 [0.001, 0.002,   0.5,   0.6, 0.003, 0.001],
...                 trim_level=0.01)
>>> band.wave
array([ 4100.,  4200.,  4300.,  4400.])
>>> band.trans
array([ 0.002,  0.5  ,  0.6  ,  0.003])

While less strictly correct than including the “out-of-band” transmission, only considering the region of the bandpass where transmission is significant can improve model-bandpass overlap as well as performance.

__init__(wave, trans, wave_unit=Unit('Angstrom'), trans_unit=Unit(dimensionless), normalize=False, name=None, trim_level=None)[source]


__init__(wave, trans[, wave_unit, ...])



shifted(factor[, name])

Return a new Bandpass instance with all wavelengths multiplied by a factor.



Effective wavelength of bandpass in Angstroms.