Spectral templates

class qmostetc.SEDTemplate(template)

Spectrum template

There are a number of templates available from the ICR which can be retrieved directly by the name. The name prefixes may be omitted as long as the name remains unique.

Known templates include:

  • Pickles_A0III, A0V, B2IV, B9III, B9V, G0V, G5V, K2V, K7V, M2V, O5V, O9V

  • Kinney_bulge, ell, s0, sa, sb, sc, starb1, starb2, starb3, starb4, starb5, starb6

The full list of templates can be retrieved with the list() function.

User defined templates can be created by either specifying the file name of a FITS file, or by providing a Spectrum.

The template is callable; calling it with the magnitude and the mag filter will return the scaled flux.

Parameters:
templatestr or pathlib.Path or Spectrum

SEDTemplate name, file name to template FITS file, or a spectrum.

Examples

Create a spectrum from a standard star template and print the average flux between 500 and 550 nm:

>>> from qmostetc import SEDTemplate
>>> import astropy.units as u
>>> pck = SEDTemplate('Pickles_G0V')
>>> flux = pck(15*u.ABmag, 'GAIA_GAIA2r.G')
>>> print(f'{flux.subspectrum(500*u.nm, 550*u.nm).flux.mean():.2e}')
9.68e-03 ph / (nm s cm2)

Create an atmospheric emission spectrum scaled to a given magnitude and print the average flux between 500 and 550 nm. Note that for surface brightness, the area (arcsec²) needs to be given manually:

>>> from qmostetc import Atmosphere, SEDTemplate, Spectrum
>>> import astropy.units as u
>>> atm = Atmosphere.paranal()
>>> tpl = SEDTemplate(atm.emission())
>>> flx = tpl(23*u.ABmag, 'GAIA_GAIA2r.G') / u.arcsec**2
>>> print(f'{flx.subspectrum(500*u.nm, 550*u.nm).flux.mean():.2e}')
4.32e-06 ph / (nm s arcsec2 cm2)
Attributes:
wavelengthastropy.units.Quantity

Wavelength array [nm]

fluxastropy.units.Quantity

Unscaled template flux [erg/(s cm² nm)]

__call__(mag, filter_)

Create a spectrum from a magnitude and a filter

There are a number of filters available from the ICR which can be retrieved directly by the name. The name prefixes may be omitted as long as the name remains unique.

The list of filters includes:

  • GAIA2r.Gbp, GAIA2r.G, GAIA2r.Grp

  • CTIO DECam.g, DECam.i, DECam.r, DECam.u, DECam.z

  • Generic Bessell.U, Cousins.I, Cousins.R, Johnson.B, Johnson.V

  • Paranal VISTA.H, VISTA.J, VISTA.Ks, VISTA.Y, VISTA.Z

The complete list of filters can be retrieved with the Filter.list() function.

User defined filters can be used by providing a file name instead. Note that SDSS filters are not in the list of standard filters and need to be provided as file name.

Parameters:
magastropy.units.Quantity

Magnitude [ABmag, VEGAmag or STmag]. If the template flux is given as surface flux (per arcsec²), the magnitude is interpreted as surface magnitude as well.

filter_str or pathlib.Path

Filter name or path to template FITS file

Returns:
Spectrum

Fluxspectrum from template, scaled according to the given magnitude [ph / (cm² s nm)]

redshift(z=0.0)

Return a template with a certain redshift applied

Parameters:
zfloat

Redshift

Returns:
SEDTemplate

Redshifted template. If redshift is zero, the template itself is returned.

redden(e_bv=<Quantity 0. mag>, r_v=3.1)

Return a template with a certain reddening applied

As extinction model, fitzpatrick99 [1999PASP..111…63F] is implemented.

Parameters:
e_bvastropy.unity.Quantity

Selective extinction between B and V band [mag].

r_vfloat

Ratio of total to selective extinction, A_V / E(B-V).

Returns:
SEDTemplate

Reddened template. If reddening is zero, the template itself is returned.

static list()

List all available templates

This function lists all templates that are available from ICR. These names can be used to create an SEDTemplate object.

Returns:
list

List of template names

Examples

>>> from qmostetc import SEDTemplate
>>> SEDTemplate.list()
['Kinney_bulge', 'Kinney_ell', 'Kinney_s0', ...]