The SKIRT project
advanced radiative transfer for astrophysics
BinnedWavelengthDistribution Class Reference

#include <BinnedWavelengthDistribution.hpp>

Inheritance diagram for BinnedWavelengthDistribution:

Protected Member Functions

 BinnedWavelengthDistribution ()
double wavelengthInBin (int ell) const override
Protected Member Functions inherited from GridWavelengthDistribution
 GridWavelengthDistribution ()
void setupSelfAfter () override
Protected Member Functions inherited from WavelengthDistribution
 WavelengthDistribution ()
Randomrandom () const
void setupSelfBefore () override
Protected Member Functions inherited from SimulationItem
 SimulationItem ()
virtual bool offersInterface (const std::type_info &interfaceTypeInfo) const
Protected Member Functions inherited from Item
 Item ()

Private Types

using BaseType
using ItemType

Friends

class ItemRegistry

Additional Inherited Members

Public Member Functions inherited from GridWavelengthDistribution
double generateWavelength () const override
double probability (double wavelength) const override
DisjointWavelengthGridwavelengthGrid () const
Public Member Functions inherited from SimulationItem
template<class T>
T * find (bool setup=true) const
template<class T>
T * interface (int upLevels, int downLevels, bool setup) 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

Detailed Description

BinnedWavelengthDistribution is a specialty class for representing wavelength probability distributions derived from a wavelength grid that can be configured by the user, in which the generated wavelengths are spread across the full width of each bin instead of being concentrated at the bin's characteristic wavelength. This allows a relatively coarse wavelength grid to still yield a quasi-continuous sampling of wavelength space, for example to properly represent the continuum near an emission or absorption line without requiring an unnecessarily fine wavelength grid (and the corresponding increase in computational cost).

When a BinnedWavelengthDistribution instance is used as the wavelength bias distribution for a source with a composite bias factor of one, the source will emit photon packets across the full width of the (in-range) bins of the configured grid, with equal probability per bin, and with a uniform probability density within each bin. More precisely, the BinnedWavelengthDistribution instance uses only the bins of the configured grid for which the characteristic wavelength falls inside the wavelength range of the associated source (obtained through the SourceWavelengthRangeInterface). If none of the characteristic wavelengths fall inside the source range, a fatal error is issued.

See also DiscreteWavelengthDistribution, which offers similar functionality but concentrates the generated wavelengths at the bin's characteristic wavelength instead. This is required, for example, when mimicking codes that emit photon packets at a fixed set of discrete wavelengths.

Constructor & Destructor Documentation

◆ BinnedWavelengthDistribution()

BinnedWavelengthDistribution::BinnedWavelengthDistribution ( )
inlineprotected

Default constructor for concrete Item subclass BinnedWavelengthDistribution: "a binned wavelength probability distribution derived from a wavelength grid".

Member Function Documentation

◆ wavelengthInBin()

double BinnedWavelengthDistribution::wavelengthInBin ( int ell) const
overrideprotectedvirtual

This function returns a random wavelength, uniformly distributed across the full width of the given bin.

Implements GridWavelengthDistribution.


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