Package astLib :: Module astSED
[hide private]
[frames] | no frames]

Module astSED

source code

module for performing calculations on Spectral Energy Distributions (SEDs)

(c) 2007-2013 Matt Hilton

http://astlib.sourceforge.net

This module provides classes for manipulating SEDs, in particular the Bruzual & Charlot 2003, Maraston 2005, and Percival et al 2009 stellar population synthesis models are currently supported. Functions are provided for calculating the evolution of colours and magnitudes in these models with redshift etc., and for fitting broadband photometry using these models.

Classes [hide private]
  Passband
This class describes a filter transmission curve.
  TopHatPassband
This class generates a passband with a top hat response between the given wavelengths.
  SED
This class describes a Spectral Energy Distribution (SED).
  VegaSED
This class stores the SED of Vega, used for calculation of magnitudes on the Vega system.
  StellarPopulation
This class describes a stellar population model, either a Simple Stellar Population (SSP) or a Composite Stellar Population (CSP), such as the models of Bruzual & Charlot 2003 or Maraston 2005.
  M05Model
This class describes a Maraston 2005 stellar population model.
  BC03Model
This class describes a Bruzual & Charlot 2003 stellar population model, extracted from a GALAXEV .ised file using the galaxevpl program that is included in GALAXEV.
  P09Model
This class describes a Percival et al 2009 (BaSTI; http://albione.oa-teramo.inaf.it) stellar population model.
Functions [hide private]
list
makeModelSEDDictList(modelList, z, passbandsList, labelsList=[], EBMinusVList=[0.0], forceYoungerThanUniverse=True)
This routine makes a list of SEDDict dictionaries (see mags2SEDDict) for fitting using fitSEDDict.
source code
dictionary
fitSEDDict(SEDDict, modelSEDDictList)
Fits the given SED dictionary (made using mags2SEDDict) with the given list of model SED dictionaries.
source code
dictionary
mags2SEDDict(ABMags, ABMagErrs, passbands)
Takes a set of corresponding AB magnitudes, uncertainties, and passbands, and returns a dictionary with keys 'flux', 'fluxErr' 'wavelength'.
source code
list
mag2Flux(ABMag, ABMagErr, passband)
Converts given AB magnitude and uncertainty into flux, in erg/s/cm^2/Angstrom.
source code
list
flux2Mag(flux, fluxErr, passband)
Converts given flux and uncertainty in erg/s/cm^2/Angstrom into AB magnitudes.
source code
float
mag2Jy(ABMag)
Converts an AB magnitude into flux density in Jy
source code
float
Jy2Mag(fluxJy)
Converts flux density in Jy into AB magnitude
source code
Variables [hide private]
SED object VEGA = VegaSED()
The SED of Vega, used for calculation of magnitudes on the Vega system.
SED object AB = SED(wavelength= numpy.logspace(1, 8, 1e5), flux= numpy.on...
Flat spectrum SED, used for calculation of magnitudes on the AB system.
SED object SOL = SED()
The SED of the Sun.
Function Details [hide private]

makeModelSEDDictList(modelList, z, passbandsList, labelsList=[], EBMinusVList=[0.0], forceYoungerThanUniverse=True)

source code 

This routine makes a list of SEDDict dictionaries (see mags2SEDDict) for fitting using fitSEDDict. This speeds up the fitting as this allows us to calculate model SED magnitudes only once, if all objects to be fitted are at the same redshift. We add some meta data to the modelSEDDicts (e.g. the model file names).

The effect of extinction by dust (assuming the Calzetti et al. 2000 law) can be included by giving a list of E(B-V) values.

If forceYoungerThanUniverse == True, ages which are older than the universe at the given z will not be included.

Parameters:
  • modelList (list of StellarPopulation model objects) - list of StellarPopulation models to include
  • z (float) - redshift to apply to all stellar population models in modelList
  • EBMinusVList (list) - list of E(B-V) extinction values to apply to all models, in magnitudes
  • labelsList (list) - optional list used for labelling passbands in output SEDDicts
  • forceYoungerThanUniverse (bool) - if True, do not allow models that exceed the age of the universe at z
Returns: list
list of dictionaries containing model fluxes, to be used as input to fitSEDDict.

fitSEDDict(SEDDict, modelSEDDictList)

source code 

Fits the given SED dictionary (made using mags2SEDDict) with the given list of model SED dictionaries. The latter should be made using makeModelSEDDictList, and entries for fluxes should correspond directly between the model and SEDDict.

Returns a dictionary with best fit values.

Parameters:
  • SEDDict (dictionary, in format of mags2SEDDict) - dictionary of observed fluxes and uncertainties, in format of mags2SEDDict
  • modelSEDDictList (list of dictionaries, in format of makeModelSEDDictList) - list of dictionaries containing fluxes of models to be fitted to the observed fluxes listed in the SEDDict. This should be made using makeModelSEDDictList.
Returns: dictionary
results of the fitting - keys:
  • 'minChiSq': minimum chi squared value of best fit
  • 'chiSqContrib': corresponding contribution at each passband to the minimum chi squared value
  • 'ageGyr': the age in Gyr of the best fitting model
  • 'modelFileName': the file name of the stellar population model corresponding to the best fit
  • 'modelListIndex': the index of the best fitting model in the input modelSEDDictList
  • 'norm': the normalisation that the best fit model should be multiplied by to match the SEDDict
  • 'z': the redshift of the best fit model
  • 'E(B-V)': the extinction, E(B-V), in magnitudes, of the best fit model

mags2SEDDict(ABMags, ABMagErrs, passbands)

source code 

Takes a set of corresponding AB magnitudes, uncertainties, and passbands, and returns a dictionary with keys 'flux', 'fluxErr' 'wavelength'. Fluxes are in units of erg/s/cm^2/Angstrom, wavelength in Angstroms. These dictionaries are the staple diet of the fitSEDDict routine.

Parameters:
  • ABMags (list or numpy array) - AB magnitudes, specified in corresponding order to passbands and ABMagErrs
  • ABMagErrs (list or numpy array) - AB magnitude errors, specified in corresponding order to passbands and ABMags
  • passbands (list of Passband objects) - passband objects, specified in corresponding order to ABMags and ABMagErrs
Returns: dictionary
dictionary with keys {'flux', 'fluxErr', 'wavelength'}, suitable for input to fitSEDDict

mag2Flux(ABMag, ABMagErr, passband)

source code 

Converts given AB magnitude and uncertainty into flux, in erg/s/cm^2/Angstrom.

Parameters:
  • ABMag (float) - magnitude on AB system in passband
  • ABMagErr (float) - uncertainty in AB magnitude in passband
  • passband (Passband object) - Passband object at which ABMag was measured
Returns: list
[flux, fluxError], in units of erg/s/cm^2/Angstrom

flux2Mag(flux, fluxErr, passband)

source code 

Converts given flux and uncertainty in erg/s/cm^2/Angstrom into AB magnitudes.

Parameters:
  • flux (float) - flux in erg/s/cm^2/Angstrom in passband
  • fluxErr (float) - uncertainty in flux in passband, in erg/s/cm^2/Angstrom
  • passband (Passband object) - Passband object at which ABMag was measured
Returns: list
[ABMag, ABMagError], in AB magnitudes

mag2Jy(ABMag)

source code 

Converts an AB magnitude into flux density in Jy

Parameters:
  • ABMag (float) - AB magnitude
Returns: float
flux density in Jy

Jy2Mag(fluxJy)

source code 

Converts flux density in Jy into AB magnitude

Parameters:
  • fluxJy (float) - flux density in Jy
Returns: float
AB magnitude

Variables Details [hide private]

AB

Flat spectrum SED, used for calculation of magnitudes on the AB system.
Type:
SED object
Value:
SED(wavelength= numpy.logspace(1, 8, 1e5), flux= numpy.ones(1e6))