Filter

class starkit.filters.Filter(wavelength, transmission, detector='photon', name=None)[source]

Bases: object

Response curve of a photometric filter.

Parameters:
wavelengthastropy.units.Quantity or array

wavelengths of the curve, increasing; numbers without a unit are taken as Angstrom

transmissionarray

response at these wavelengths, on any scale

detectorstr

‘photon’ (the default) for a curve giving the relative number of photons detected, as for a filter used with a CCD or infrared array, including measured filter transmissions; ‘energy’ for an energy response function, as published for photomultiplier photometry

namestr, optional

Attributes Summary

pivot_wavelength

Pivot wavelength, which converts the mean f_nu to the mean f_lambda.

Methods Summary

energy_response(wavelength)

Energy-weighted response on the given wavelengths.

from_svo(filter_id[, detector, cache])

Download a filter curve from the SVO Filter Profile Service.

mean_flux_density(wavelength, flux)

Mean f_lambda of a spectrum through the filter.

read(path[, wavelength_unit, detector, name])

Read a filter curve from a text file.

zero_point(mag_type)

Mean f_lambda of a magnitude of 0, in erg/(s cm2 Angstrom).

Attributes Documentation

pivot_wavelength

Pivot wavelength, which converts the mean f_nu to the mean f_lambda.

For a photon-counting curve S, lambda_p^2 = int S lambda dlambda / int S / lambda dlambda (Bessell & Murphy 2012, equation A16); for an energy response S’, int S’ dlambda / int S’ / lambda^2 dlambda.

Methods Documentation

energy_response(wavelength)[source]

Energy-weighted response on the given wavelengths.

This is the transmission times the wavelength for a photon-counting filter, and the transmission for an energy response, interpolated linearly and zero outside the curve.

Raises:
ValueError

if more than 1% of the filter’s response lies outside the given wavelengths

classmethod from_svo(filter_id, detector=None, cache=True)[source]

Download a filter curve from the SVO Filter Profile Service.

Parameters:
filter_idstr

SVO filter ID, such as ‘2MASS/2MASS.Ks’; wsynphot-style IDs such as ‘2MASS/2MASS/Ks’ are also accepted

detectorstr, optional

‘photon’ or ‘energy’ in place of the detector type given by SVO

cachebool

keep the curve in the astropy download cache [default True]

mean_flux_density(wavelength, flux)[source]

Mean f_lambda of a spectrum through the filter.

Parameters:
wavelengthastropy.units.Quantity or array

wavelengths of the spectrum; numbers are taken as Angstrom

fluxarray

f_lambda of the spectrum

Returns:
float

mean f_lambda, in the unit of flux

classmethod read(path, wavelength_unit=Unit('Angstrom'), detector='photon', name=None)[source]

Read a filter curve from a text file.

The file has two columns, wavelength and transmission, separated by white space. Lines starting with # are skipped.

Parameters:
pathstr or pathlib.Path
wavelength_unitastropy.units.Unit

unit of the wavelength column [default Angstrom]

detectorstr

‘photon’ (the default) or ‘energy’; see Filter

namestr, optional

the file name without its extension by default

zero_point(mag_type)[source]

Mean f_lambda of a magnitude of 0, in erg/(s cm2 Angstrom).

Parameters:
mag_typestr

‘vega’ for the mean flux density of Vega (see vega_spectrum), ‘ab’ for a source with f_nu = 3631 Jy