The SKIRT project
advanced radiative transfer for astrophysics
FileBorderWavelengthGrid Class Reference

#include <FileBorderWavelengthGrid.hpp>

Inheritance diagram for FileBorderWavelengthGrid:

Public Types

enum class  Characteristic : int { Linear , Logarithmic , Specified }

Public Member Functions

Characteristic characteristic () const
string filename () 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

 FileBorderWavelengthGrid ()
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

Characteristic _characteristic
string _filename

Friends

class ItemRegistry

Detailed Description

FileBorderWavelengthGrid 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 borders and possibly the characteristic wavelengths of the wavelength grid bins. 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 precise behavior is governed by the value of the characteristic configuration property. If the value is Linear or Logarithmic, the wavelengths loaded from the file represent the borders of the wavelength grid bins. The order of the wavelengths in the file is not important; they will be sorted anyway. There must be at least two strictly positive wavelength values in the file, and duplicates are not allowed. The characteristic wavelength for each bin is derived automatically by linear or logarithmic interpolation depending on the value of characteristic.

If the value of characteristic is Specified, the characteristic wavelengths for each bin are included in the wavelength list loaded from the file, interleaved with the border wavelengths (i.e., borders and characteristic wavelengths alternate). The number of values must be uneven and at least three. The list must be in strictly increasing or decreasing order, which means duplicates are not allowed, except that a zero characteristic wavelength indicates a segment that is not part of the grid, i.e. that lies between two non-adjacent bins. In other words, this option allows to (1) arbitrarily place characteristic wavelengths within each bin and (2) to specify intermediate wavelength ranges that are not covered by any bin.

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.

Member Enumeration Documentation

◆ Characteristic

The enumeration type indicating how to determine the characteristic wavelength for each bin. See the class header for more information.

Linear : "using linear interpolation".

Logarithmic : "using logarithmic interpolation".

Specified : "specified in the imported wavelength list".

Constructor & Destructor Documentation

◆ FileBorderWavelengthGrid()

FileBorderWavelengthGrid::FileBorderWavelengthGrid ( )
inlineprotected

Default constructor for concrete Item subclass FileBorderWavelengthGrid: "a wavelength grid loaded from a text file listing bin borders".

Member Function Documentation

◆ characteristic()

Characteristic FileBorderWavelengthGrid::characteristic ( ) const
inline

This function returns the value of the discoverable Characteristic enumeration property characteristic: "determine the characteristic wavelength for each bin".

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

◆ filename()

string FileBorderWavelengthGrid::filename ( ) const
inline

This function returns the value of the discoverable string property filename: "the name of the file with the wavelength bin borders".

◆ setupSelfBefore()

void FileBorderWavelengthGrid::setupSelfBefore ( )
overrideprotectedvirtual

This function sets the wavelength grid to the bin borders loaded from the specified file.

Reimplemented from SimulationItem.


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