This class describes a Spectral Energy Distribution (SED).
To create a SED object, lists (or numpy arrays) of wavelength and
relative flux must be provided. The SED can optionally be redshifted. The
wavelength units of SEDs are assumed to be Angstroms - flux calculations
using Passband and SED objects specified with different wavelength units
will be incorrect.
|
__init__(self,
wavelength=[],
flux=[],
z=0.0,
ageGyr=None,
normalise=False,
label=None) |
source code
|
|
SED object
|
|
|
loadFromFile(self,
fileName)
Loads SED from a white space delimited file in the format wavelength,
flux. |
source code
|
|
|
writeToFile(self,
fileName)
Writes SED to a white space delimited file in the format wavelength,
flux. |
source code
|
|
list
|
asList(self)
Returns a two dimensional list of [wavelength, flux], suitable for
plotting by gnuplot. |
source code
|
|
|
plot(self,
xmin='min',
xmax='max')
Produces a simple (wavelength, flux) plot of the SED. |
source code
|
|
float
|
integrate(self,
wavelengthMin='min',
wavelengthMax='max')
Calculates flux in SED within given wavelength range. |
source code
|
|
|
smooth(self,
smoothPix)
Smooths SED.flux with a uniform (boxcar) filter of width smoothPix. |
source code
|
|
|
|
|
normalise(self,
minWavelength='min',
maxWavelength='max')
Normalises the SED such that the area under the specified wavelength
range is equal to 1. |
source code
|
|
|
normaliseToMag(self,
ABMag,
passband)
Normalises the SED to match the flux equivalent to the given AB
magnitude in the given passband. |
source code
|
|
|
matchFlux(self,
matchSED,
minWavelength,
maxWavelength)
Matches the flux in the wavelength range given by minWavelength,
maxWavelength to the flux in the same region in matchSED. |
source code
|
|
float
|
|
float
|
calcMag(self,
passband,
addDistanceModulus=True,
magType="Vega")
Calculates magnitude in the given passband. |
source code
|
|
float
|
calcColour(self,
passband1,
passband2,
magType="Vega")
Calculates the colour passband1-passband2. |
source code
|
|
|
getSEDDict(self,
passbands)
This is a convenience function for pulling out fluxes from a SED for
a given set of passbands in the same format as made by mags2SEDDict - designed to make fitting code
simpler. |
source code
|
|
|
|