The SKIRT project
advanced radiative transfer for astrophysics
Public Member Functions | Private Attributes | List of all members
PlanckFunction Class Reference

#include <PlanckFunction.hpp>

Public Member Functions

 PlanckFunction (double T)
 
double cdf (Array &lambdav, Array &pv, Array &Pv, Range lambdaRange) const
 
double operator() (double lambda) const
 
double value (double lambda) const
 

Private Attributes

double _f1
 
double _f2
 
double _T
 

Detailed Description

This class represents the Planck function

\[ B_\lambda(\lambda,T) = \frac{2hc^2}{\lambda^5}\, \frac{1}{\exp\left(\dfrac{hc}{\lambda kT}\right)-1}. \]

The temperature \(T\) is specified in the constructor.

Constructor & Destructor Documentation

◆ PlanckFunction()

PlanckFunction::PlanckFunction ( double  T)
explicit

The constructor for the PlanckFunction class accepts the temperature \(T\) and precalculates some constants for later use.

Member Function Documentation

◆ cdf()

double PlanckFunction::cdf ( Array lambdav,
Array pv,
Array Pv,
Range  lambdaRange 
) const

This function constructs a tabulated normalized probability density function (pdf) and the corresponding normalized cumulative distribution function (cdf) for the Planck function with temperature \(T\) (specified in the constructor) within the given wavelength range. As the basis for the tabulation, the function constructs a logarithmic wavelength grid with approximately 1000 wavelength points for each order of magitude in the wavelength range. The integration to determine the cdf is performed using a mechanism that assumes that the pdf behaves as a power-law between any two grid points.

◆ operator()()

double PlanckFunction::operator() ( double  lambda) const
inline

This function call operator returns the value of the Planck function \(B_\lambda(\lambda,T)\) for a given wavelength \(\lambda\) and for the temperature \(T\) specified in the constructor. It is equivalent to the value() function.

◆ value()

double PlanckFunction::value ( double  lambda) const

This function returns the value of the Planck function \(B_\lambda(\lambda,T)\) for a given wavelength \(\lambda\) and for the temperature \(T\) specified in the constructor.


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