webbpsf_ext.spectra.stellar_spectrum

webbpsf_ext.spectra.stellar_spectrum(sptype, *renorm_args, **kwargs)[source]

Stellar spectrum

Similar to specFromSpectralType() in WebbPSF/Poppy, this function uses a dictionary of fiducial values to determine an appropriate spectral model. If the input spectral type is not found, this function interpolates the effective temperature, metallicity, and log g values .

You can also specify renormalization arguments to pass to sp.renorm(). The order (after sptype) should be (value, units, bandpass):

>>> sp = stellar_spectrum('G2V', 10, 'vegamag', bp)

Flat spectrum (in photlam) are also allowed via the ‘flat’ string.

Use catname='bosz' for BOSZ stellar atmosphere (ATLAS9) (default) Use catname='ck04models' keyword for ck04 models Use catname='phoenix' keyword for Phoenix models

Keywords exist to directly specify Teff, metallicity, an log_g rather than a spectral type.

Parameters
  • sptype (str) – Spectral type, such as ‘A0V’ or ‘K2III’.

  • renorm_args (tuple) – Renormalization arguments to pass to sp.renorm(). The order (after sptype) should be (value, units, bandpass) Bandpass should be a pysynphot.obsbandpass type.

Keyword Arguments
  • catname (str) – Catalog name, including ‘bosz’, ‘ck04models’, and ‘phoenix’. Default is ‘bosz’, which comes from BOSZ_spectrum().

  • Teff (float) – Effective temperature ranging from 3500K to 30000K.

  • metallicity (float) – Metallicity [Fe/H] value ranging from -2.5 to 0.5.

  • log_g (float) – Surface gravity (log g) from 0 to 5.

  • res (str) – BOSZ spectral resolution to use (200 or 2000 or 20000). Default: 2000.

  • interpolate (bool) – Interpolate BOSZ spectrum using a weighted average of grid points surrounding the desired input parameters. Default is True. Default: True