The SKIRT project
advanced radiative transfer for astrophysics
BandWavelengthGrid Class Referenceabstract

#include <BandWavelengthGrid.hpp>

Inheritance diagram for BandWavelengthGrid:

Public Member Functions

const Bandband (int ell) const
int bin (double lambda) const override
vector< int > bins (double lambda) const override
double effectiveWidth (int ell) const override
double leftBorder (int ell) const override
int numBins () const override
double rightBorder (int ell) const override
double transmission (int ell, double lambda) const override
double wavelength (int ell) const override
Public Member Functions inherited from WavelengthGrid
Range wavelengthRange () 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

 BandWavelengthGrid ()
virtual vector< Band * > bandList ()=0
void setupSelfAfter () override
Protected Member Functions inherited from WavelengthGrid
 WavelengthGrid ()
Protected Member Functions inherited from SimulationItem
 SimulationItem ()
virtual bool offersInterface (const std::type_info &interfaceTypeInfo) const
virtual void setupSelfBefore ()
Protected Member Functions inherited from Item
 Item ()

Private Types

using BaseType
using ItemType

Private Attributes

vector< Band * > _bands

Friends

class ItemRegistry

Detailed Description

BandWavelengthGrid is an asbtract class for representing wavelength grids where each bin is defined by a Band object. Each Band object provides the transmission curve and the other (derived) properties for the corresponding bin. Examples include the standard Johnson filters and the broadbands for actual observatories such as GALEX, SDSS or Herschel. See the Band class for more information.

Each subclass must override the bandList() method to return a list of Band objects. The bands are automatically sorted in order of increasing pivot wavelength, even if the list returned by the subclass has them in a different order. The intervals in which the transmission is nonzero is allowed to overlap, but no two bands in the list should have the same pivot wavelength (this restriction essentially disallows specifying the same band twice).

Constructor & Destructor Documentation

◆ BandWavelengthGrid()

BandWavelengthGrid::BandWavelengthGrid ( )
inlineprotected

Default constructor for abstract Item subclass BandWavelengthGrid: "a wavelength grid defined by a list of (broad)bands".

Member Function Documentation

◆ band()

const Band * BandWavelengthGrid::band ( int ell) const

This function returns (a pointer to) the Band object defining the transmission curve for the bin with index \(\ell\).

◆ bandList()

virtual vector< Band * > BandWavelengthGrid::bandList ( )
protectedpure virtual

This function must be implemented by each subclass to return a list of Band objects in arbitrary order (the bands will be sorted in order of increasing pivot wavelength by this class).

Implemented in ConfigurableBandWavelengthGrid, and PredefinedBandWavelengthGrid.

◆ bin()

int BandWavelengthGrid::bin ( double lambda) const
overridevirtual

This function returns the index \(\ell\) of a band that may have a nonzero transmission at the specified wavelength \(\lambda\), i.e. for which \(\lambda^\mathrm{left}_\ell \le \lambda \le \lambda^\mathrm{right}_\ell\). If no bands match this condition, the function returns -1. If multiple bands match this condition, the function returns the index for the band with the shortest characteristic wavelength.

Implements WavelengthGrid.

◆ bins()

vector< int > BandWavelengthGrid::bins ( double lambda) const
overridevirtual

This function returns a list of indices \(\ell_k\) of the bands that may have a nonzero transmission at the specified wavelength \(\lambda\), i.e. for which \(\lambda^\mathrm{left}_\ell \le \lambda \le \lambda^\mathrm{right}_\ell\). If no bands match this condition, the function returns an empty list.

Implements WavelengthGrid.

◆ effectiveWidth()

double BandWavelengthGrid::effectiveWidth ( int ell) const
overridevirtual

This function returns the effective width of the band corresponding to the index \(\ell\). Refer to the Band class for the relevant formulas.

Implements WavelengthGrid.

◆ leftBorder()

double BandWavelengthGrid::leftBorder ( int ell) const
overridevirtual

This function returns the left wavelength border of the band corresponding to the index \(\ell\). The transmission for this band is guaranteed to be zero for all wavelengths shorter than the left border.

Implements WavelengthGrid.

◆ numBins()

int BandWavelengthGrid::numBins ( ) const
overridevirtual

This function returns the number of bands in the grid (or equivalently, the number of bins). Bands are always sorted in order of increasing pivot wavelength.

Implements WavelengthGrid.

◆ rightBorder()

double BandWavelengthGrid::rightBorder ( int ell) const
overridevirtual

This function returns the right wavelength border of the band corresponding to the index \(\ell\). The transmission for this band is guaranteed to be zero for all wavelengths longer than the right border.

Implements WavelengthGrid.

◆ setupSelfAfter()

void BandWavelengthGrid::setupSelfAfter ( )
overrideprotectedvirtual

This function obtains the bands from the subclass and sorts them in order of increasing pivot wavelength.

Reimplemented from SimulationItem.

◆ transmission()

double BandWavelengthGrid::transmission ( int ell,
double lambda ) const
overridevirtual

This function returns the relative transmission for the band corresponding to the index \(\ell\) at the wavelength \(\lambda\). Refer to the Band class for the relevant formulas.

Implements WavelengthGrid.

◆ wavelength()

double BandWavelengthGrid::wavelength ( int ell) const
overridevirtual

This function returns the pivot wavelength for the band corresponding to the index \(\ell\). Refer to the Band class for the relevant formulas. Bands are always sorted in order of increasing pivot wavelength.

Implements WavelengthGrid.


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