|
| double | generateWavelength () const override |
| double | probability (double wavelength) const override |
| DisjointWavelengthGrid * | wavelengthGrid () const |
| 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 |
| | 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 Item * | getItemProperty (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) |
| Item & | operator= (const Item &)=delete |
| Item * | parent () 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 |
GridWavelengthDistribution is an abstract class for representing wavelength probability distributions derived from a wavelength grid that can be configured by the user. The distribution 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), and those bins are selected with equal probability. If none of the characteristic wavelengths fall inside the source range, a fatal error is issued.
Each subclass determines how an actual wavelength is drawn from within a selected bin (see the wavelengthInBin() function); this abstract class handles everything else, including a probability() function that treats the generated wavelengths as if they were spread out evenly over each selected bin, regardless of the precise recipe used by the subclass to place a wavelength inside the bin.
| double GridWavelengthDistribution::probability |
( |
double | wavelength | ) |
const |
|
overridevirtual |
This function returns the probability of the distribution at the given wavelength. It acts as if the wavelengths generated by the generateWavelength() function were spread out over each bin (rather than being concentrated into a single wavelength). The returned probability is zero for wavelengths outside of the (in-range) bins of the configured wavelength grid. For a wavelength that falls inside bin \(\ell\), the returned probability is given by \( p_\ell = 1 / (\Delta\lambda_\ell \, N_\text{bins}) \), where \(\Delta\lambda_\ell\) is the width of the bin and \(N_\text{bins}\) is the number of (in-range) bins. This value is inversely proportional to the bin width, and satisfies the normalization condition \(\sum_\ell p_\ell = 1\).
Implements WavelengthDistribution.