The SKIRT project
advanced radiative transfer for astrophysics
FileWavelengthGrid Class Reference

#include <FileWavelengthGrid.hpp>

Inheritance diagram for FileWavelengthGrid:

Public Member Functions

string filename () const
bool log () const
double relativeHalfWidth () const
Public Member Functions inherited from DisjointWavelengthGrid
int bin (double lambda) const override
vector< int > bins (double lambda) const override
const Arraydlambdav () const
double effectiveWidth (int ell) const override
Array extdlambdav () const
Array extlambdav () const
const Arraylambdav () const
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

 FileWavelengthGrid ()
void setupSelfBefore () override
Protected Member Functions inherited from DisjointWavelengthGrid
 DisjointWavelengthGrid ()
void setupSelfAfter () override
void setWavelengthBins (const Array &lambdav, double relativeHalfWidth, bool constantWidth=false)
void setWavelengthBorders (const Array &borderv, bool logScale)
void setWavelengthRange (const Array &lambdav, bool logScale)
void setWavelengthSegments (const Array &bordcharv)
void setWavelengthSegments (const vector< double > &borderv, const vector< double > &characv)
Protected Member Functions inherited from WavelengthGrid
 WavelengthGrid ()
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

Private Attributes

string _filename
bool _log
double _relativeHalfWidth

Friends

class ItemRegistry

Detailed Description

FileWavelengthGrid is a subclass of the DisjointWavelengthGrid class representing wavelength grids loaded from an input file. The floating point numbers in the first column of the text file specify the characteristic wavelengths. The default unit is micron, but this can be overridden by a column header (see TextInFile). Any additional columns in the file are ignored. The order of the wavelengths in the file is not important; they will be sorted anyway.

In all cases, the wavelengths loaded from the file represent the characteristic wavelengths of the grid bins, and the bin borders are derived automatically. Note that the outermost bin borders are placed beyond the outermost characteristic wavelengths.

If relativeHalfWidth is zero (the default value) the class constructs a consecutive range of adjacent wavelength bins in linear or logarithmic space depending on the value of the log flag. For more details, refer to the DisjointWavelengthGrid::setWavelengthRange() function.

If relativeHalfWidth is nonzero, the class constructs a set of distinct nonadjacent wavelength bins with the specified relative half bin width. In this case, the value of the log flag is ignored. For more details, refer to the DisjointWavelengthGrid::setWavelengthBins() function.

This item type is displayed only if the Boolean expression "Level2" evaluates to true after replacing the names by true or false depending on their presence.

Constructor & Destructor Documentation

◆ FileWavelengthGrid()

FileWavelengthGrid::FileWavelengthGrid ( )
inlineprotected

Default constructor for concrete Item subclass FileWavelengthGrid: "a wavelength grid loaded from a text file".

Member Function Documentation

◆ filename()

string FileWavelengthGrid::filename ( ) const
inline

This function returns the value of the discoverable string property filename: "the name of the file with the characteristic wavelengths".

◆ log()

bool FileWavelengthGrid::log ( ) const
inline

This function returns the value of the discoverable Boolean property log: "use logarithmic scale".

The default value for this property is given by the conditional value expression "true".

This property is relevant only if the Boolean expression "!relativeHalfWidth" evaluates to true after replacing the names by true or false depending on their presence.

◆ relativeHalfWidth()

double FileWavelengthGrid::relativeHalfWidth ( ) const
inline

This function returns the value of the discoverable double property relativeHalfWidth: "the relative half width for discrete bins, or zero for a consecutive range".

The minimum value for this property is "[0".

The maximum value for this property is "1[".

The default value for this property is given by the conditional value expression "0".

◆ setupSelfBefore()

void FileWavelengthGrid::setupSelfBefore ( )
overrideprotectedvirtual

This function reads the wavelength grid points from the specified file.

Reimplemented from SimulationItem.


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