The SKIRT project
advanced radiative transfer for astrophysics
Public Member Functions | Protected Member Functions | Private Types | Private Attributes | Friends | List of all members
SED Class Referenceabstract

#include <SED.hpp>

Inheritance diagram for SED:
Inheritance graph
[legend]

Public Member Functions

virtual double generateWavelength () const =0
 
virtual double integratedLuminosity (const Range &wavelengthRange) const =0
 
virtual Range intrinsicWavelengthRange () const =0
 
Range normalizationWavelengthRange () const
 
- Public Member Functions inherited from SimulationItem
template<class T >
T * find (bool setup=true) const
 
template<class T >
T * interface (int levels=-999999, bool setup=true) const
 
virtual string itemName () const
 
void setup ()
 
string typeAndName () const
 
- Public Member Functions inherited from Item
 Item (const Item &)=delete
 
virtual ~Item ()
 
void addChild (Item *child)
 
const vector< Item * > & children () const
 
virtual void clearItemListProperty (const PropertyDef *property)
 
void destroyChild (Item *child)
 
virtual bool getBoolProperty (const PropertyDef *property) const
 
virtual vector< double > getDoubleListProperty (const PropertyDef *property) const
 
virtual double getDoubleProperty (const PropertyDef *property) const
 
virtual string getEnumProperty (const PropertyDef *property) const
 
virtual int getIntProperty (const PropertyDef *property) const
 
virtual vector< Item * > getItemListProperty (const PropertyDef *property) const
 
virtual ItemgetItemProperty (const PropertyDef *property) const
 
virtual string getStringProperty (const PropertyDef *property) const
 
int getUtilityProperty (string name) const
 
virtual void insertIntoItemListProperty (const PropertyDef *property, int index, Item *item)
 
Itemoperator= (const Item &)=delete
 
Itemparent () const
 
virtual void removeFromItemListProperty (const PropertyDef *property, int index)
 
virtual void setBoolProperty (const PropertyDef *property, bool value)
 
virtual void setDoubleListProperty (const PropertyDef *property, vector< double > value)
 
virtual void setDoubleProperty (const PropertyDef *property, double value)
 
virtual void setEnumProperty (const PropertyDef *property, string value)
 
virtual void setIntProperty (const PropertyDef *property, int value)
 
virtual void setItemProperty (const PropertyDef *property, Item *item)
 
virtual void setStringProperty (const PropertyDef *property, string value)
 
void setUtilityProperty (string name, int value)
 
virtual string type () const
 

Protected Member Functions

 SED ()
 
Randomrandom () const
 
void setupSelfBefore () override
 
- Protected Member Functions inherited from SimulationItem
 SimulationItem ()
 
virtual bool offersInterface (const std::type_info &interfaceTypeInfo) const
 
virtual void setupSelfAfter ()
 
virtual void setupSelfBefore ()
 
- Protected Member Functions inherited from Item
 Item ()
 

Private Types

using BaseType = SimulationItem
 
using ItemType = SED
 

Private Attributes

Random_random
 

Friends

class ItemRegistry
 

Detailed Description

An instance of a SED subclass represents a spectral energy distribution \(L_\lambda\), i.e. power per unit of wavelength. This abstract base class just defines an interface that must be implemented by each subclass. The two key operations supported by all SEDs are drawing a random wavelength from the spectral energy distribution and calculating the integrated luminosity over a given wavelength range.

There are two important categories of emission spectra, each represented by an abstract SED subclass:

Each SED subclass, regardless of its category, must ensure that the implemented spectral energy distribution is normalized to unity over the normalization wavelength range, which is defined as the intersection of the source wavelength range (determined by the SourceSystem) and the intrinsic wavelength range of the implemented distribution (determined by the SED subclass). A convenience function offered by this abstract base class returns this normalization wavelength range.

Specifically, this means that the random wavelengths returned by the generateWavelength() function will always fall inside the normalization range. On the other hand, while the functions calculating specific and integrated luminosities use the same normalization, they operate across the full intrinsic wavelength range of the SED without being limited by the source wavelength range. This makes it possible for a user to configure a luminosity normalization at a wavelength (or over a wavelength range) outside of the wavelength range where the sources are actually emitting.

Constructor & Destructor Documentation

◆ SED()

SED::SED ( )
inlineprotected

Default constructor for abstract Item subclass SED : "a spectral energy distribution" .

Member Function Documentation

◆ generateWavelength()

virtual double SED::generateWavelength ( ) const
pure virtual

This function returns a random wavelength drawn from the normalized spectral energy distribution limited to the normalization wavelength range.

Implemented in BlackBodySED, FamilySED, LineSED, LyaDoublePeakedSED, LyaGaussianSED, LyaSEDDecorator, ResourceSED, SingleWavelengthSED, and TabulatedSED.

◆ integratedLuminosity()

virtual double SED::integratedLuminosity ( const Range wavelengthRange) const
pure virtual

This function returns the normalized integrated luminosity \(L\) (i.e. radiative power) over the specified wavelength range, or zero if the range is fully outside of the SED's intrinsic wavelength range.

Implemented in BlackBodySED, FamilySED, LineSED, LyaDoublePeakedSED, LyaGaussianSED, LyaSEDDecorator, ResourceSED, and TabulatedSED.

◆ intrinsicWavelengthRange()

virtual Range SED::intrinsicWavelengthRange ( ) const
pure virtual

This function returns the intrinsic wavelength range of the SED. Outside this range, all luminosities are zero.

Implemented in BlackBodySED, FamilySED, LineSED, LyaDoublePeakedSED, LyaGaussianSED, LyaSEDDecorator, ResourceSED, and TabulatedSED.

◆ normalizationWavelengthRange()

Range SED::normalizationWavelengthRange ( ) const

This function returns the SED's normalization wavelength range. This range is defined as the intersection of the simulation's source wavelength range (obtained from the simulation configuration) and the intrinsic wavelength range of the SED (obtained through the abtract intrinsicWavelengthRange() function which must be impemented in each subclass.

◆ random()

Random * SED::random ( ) const
inlineprotected

This function returns the simulation's random generator as a service to subclasses.

◆ setupSelfBefore()

void SED::setupSelfBefore ( )
overrideprotectedvirtual

This function caches the simulation's random generator for use by subclasses.

Reimplemented from SimulationItem.

Reimplemented in TabulatedSED.


The documentation for this class was generated from the following file: