skOpticalProperties  2.1
Public Member Functions | List of all members
skSpectralLineShape_VoigtKuntz Class Reference

#include <skspectrallineshape_voigtkuntz.h>

Inheritance diagram for skSpectralLineShape_VoigtKuntz:
skSpectralLineShape

Public Member Functions

virtual bool LineShapeFunction (double nu, double *uservalue, const skSpectralLine *spectralline, skSpectralLineShapeStorageBuffer *storagebuffer) override
 Storage buffer from an earlier call to ConfigureStorageBuffer. More...
 
virtual bool AddLineShapeFunctionArray (const std::vector< double > &nu, std::vector< double > *uservalue, const skSpectralLine *spectralline, skSpectralLineShapeStorageBuffer *storagebuffer) override
 Storage buffer from an earlier call to ConfigureStorageBuffer. More...
 
virtual bool ConfigureLineParameters (skSpectralLine *spectralline, double temperature, double pressure, const GEODETIC_INSTANT &geopt, skClimatology *atmopshericstate, skSpectralLineShapeStorageBuffer *storagebuffer) override
 and store it in this buffer. More...
 
virtual bool CreateStorageBuffer (skSpectralLineShapeStorageBuffer **storagebuffer) override
 and store it in this buffer. More...
 
virtual bool SetParentMaxLineStrength (double parentmaxlinestrength, const skSpectralLine *spectralline, skSpectralLineShapeStorageBuffer *storagebuffer) const
 Storage buffer from an earlier call to ConfigureStorageBuffer. More...
 

Detailed Description

Implements the Voigt profile using the techniques outlined by Kuntz, 1997 and corrected for the errata published by Ruyten(2004). I have intentionally kept all of the coefficients identical to the published values even though more accurate versions may be out there. The paper claims to have systematic fractional errors of less than 10^-6 for the Voigt function over its entire domain .

Multi-Threading.
This line shape object supports multithreading simultaneous spectral lines where each spectral line uses a single trhead thread to calculate a voigt profile for an array of wavelengths.
Line thresholding
The class and its associated buffer skSpectralLineShapeStorageBuffer_VoigtKuntz use a thresholding technique to reduce the number of wavenumbers considered for any one spectral line. The basic premise is that we are tring to model the spectrum across a micro-window at thousands of wavenumbers with hundreds or thousands of spectral lines. Higher level code calculates the strongest line intensity from all of the spectral lines that contribute to the window and then we only consider wavenumber regions that contribute more than fraction m_tolerance (see class skSpectralLineShapeStorageBuffer_VoigtKuntz) to the signal. This allows us to quickly limit the upper and lower limits of X in the Voigt profile for a given Y. This technique often allows thousands of calculations to be eliminated and provides massive speedups of code with no significant loss of precision.
References
  1. M. Kuntz: A New Implementation of the Humlicek Algorithm For The Calculation Of The Voigt Profile Function, JQSRT, 57, 819, 1997.
  2. W. Ruyten: Comment "A new implementation of the Humlicek...", JQSRT, 86, 231, 2003, doi:10.1016/j.jqsrt.2003.12.027

Member Function Documentation

bool skSpectralLineShape_VoigtKuntz::LineShapeFunction ( double  nu,
double *  uservalue,
const skSpectralLine spectralline,
skSpectralLineShapeStorageBuffer storagebuffer 
)
overridevirtual

Storage buffer from an earlier call to ConfigureStorageBuffer.

[THREAD-SAFE] Calculate the Line Shape Function for a given spectral line. This interface is for single wave-number processing and is suitable for the Monte-Carlo and Successive Order engines. The controlling software must successfully called ConfigureAtmopshericState and ConfigureStorageBuffer before calling LineShapeFunction. Typically, atmospheric state information, which is common to all of the spectral lines processed, is stored within the derived SpectralLineShape object while line specific information for the given atmospheric state is stored inside the storage buffer. This function must be implemented so it is thread safe as multiple threads may be calculating LineShape for different wavenumbers or spectral lines simultaneaously

Parameters
nuThe wavenumber at which to calculate the lineshape. We dont specify vacuum or air but it should be the same as the optical properties. HITRAN cross-sections are specified in vacuum. Many other cross-sections, especially in the visible, are specified at STP.
uservaluereturns the line shape value at this wavenumber. The line shape is normalized so its total area is unity.
spectrallineThe spectral line (eg HITRAN line) object that is "using" this LineShape object. Note that one instance of skSpectralLineShape may be shared between many different spectral lines.
storagebufferAn object created by this spectral line shape object that is used to cache information about the specific spectral line being processed. Access to the cached information must be thread safe using mutexes etc as it is possible that multiple threads processing multiple wavenumbers are accessing the cached object simultaneously.

Implements skSpectralLineShape.

bool skSpectralLineShape_VoigtKuntz::AddLineShapeFunctionArray ( const std::vector< double > &  nu,
std::vector< double > *  uservalue,
const skSpectralLine spectralline,
skSpectralLineShapeStorageBuffer storagebuffer 
)
overridevirtual

Storage buffer from an earlier call to ConfigureStorageBuffer.

[THREAD-SAFE] Calculate the Line Shape Function for an array of wavenumbers. Returns the lineshape in array uservalue. This function replicates function LineShapeFunction except this method provides a derived class the ability to optimize the line shape code across an array of wavenumbers. This can be a significant saving when finding the X,Y regions of the Voigt function for example. Keep in mind that one line shape object is shared between many spectral lines and that the code will be possibly running in multiple threads processing muliple spectral lines simultaneously. A default implementation is provided which simply loops and calls LineShapeFunction.

Parameters
nuThe array of wavenumbers at which to calculate the lineshape. We dont specify vacuum or air but it should be the same as the optical properties. HITRAN cross-sections are specified in vacuum. Many other cross-sections, especially in the visible, are specified at STP.
uservaluereturns the array of line shape value. It will be same size as "nu". Note we only use the resize method to avoid unnecessary memory allocations. The line shape is normalized so its total area is unity.
spectrallineThe spectral line (eg HITRAN line) object that is "using" this LineShape object. Note that one instance of skSpectralLineShape may be shared between many different spectral lines.
storagebufferAn object created by this spectral line shape object that is used to cache information about the specific spectral line being processed. Access to the cached information must be thread safe using mutexes etc as it is possible that multiple threads processing multiple wavenumbers are accessing the cached object simultaneously.

Reimplemented from skSpectralLineShape.

bool skSpectralLineShape_VoigtKuntz::ConfigureLineParameters ( skSpectralLine spectralline,
double  temperature,
double  pressure,
const GEODETIC_INSTANT &  geopt,
skClimatology *  atmopshericstate,
skSpectralLineShapeStorageBuffer storagebuffer 
)
overridevirtual

and store it in this buffer.

[NOT THREAD-SAFE] Extract all of the necessary line parameters from the atmospheric state and spectral line. If necessary the information can be stored in the storage buffer and this storage buffer instance will be passed to future calls to LineShapeFuction. We would expect that just about all derived classes will extract temperature, SKCLIMATOLOGY_TEMPERATURE_K, and most will extract pressure, SKCLIMATOLOGY_PRESSURE_PA from atmosphericstate. Derived classes will probably extract relevant spectral line info from spectral line and possibly generate intermediate results which are then stored in the storage buffer. This function does not need to be thread safe in the sense that

Implements skSpectralLineShape.

References skSpectralLine::Deltaair(), skSpectralLine::GammaAir(), skSpectralLine::GammaSelf(), skSpectralLineCollection::MassAMU(), skSpectralLine::Nair(), skSpectralLine::Nu(), skSpectralLineCollection::PartialPressure(), and skSpectralLine::Tref().

bool skSpectralLineShape_VoigtKuntz::CreateStorageBuffer ( skSpectralLineShapeStorageBuffer **  storagebuffer)
overridevirtual

and store it in this buffer.

[NOT THREAD-SAFE] Function to create the line shape storage buffer for the spectral line. All storage buffers must derive from skSpectralLineShapeStorageBuffer, we provide templatec class skSpectralLineShapeStorageBuffer_Type for this purpose but users can provide their own solution if desired. If the creation is valid then the pointer to the storage buffer object is returned in storage buffer with a reference count of 1. The calling code must release the storage buffer with a call to "Release". This function does not need to be thread-safe.

Implements skSpectralLineShape.

bool skSpectralLineShape_VoigtKuntz::SetParentMaxLineStrength ( double  parentmaxlinestrength,
const skSpectralLine spectralline,
skSpectralLineShapeStorageBuffer storagebuffer 
) const
virtual

Storage buffer from an earlier call to ConfigureStorageBuffer.

[THREAD-SAFE] Allows the line shape object to update the useful wavenumber limits for future Voigt/lineshape function evaluations. This can be a signifcant processing optimization. This function is usually invoked after the user has moved to a different point in the atmosphere and [pressure and temperature hve changed.

Parameters
parentmaxlinestrengthThe maximum line strength considered for this micro-window calculation. The parent classes have passed in the "brightest" line in the microwindow. Given this brightness we can limit the range of wavenumbers that we need to evaluate this spectral line and still keep the calculation within a certain threshold/tolerance.
spectrallineThe spectral line (eg HITRAN line) object that is "using" this LineShape object. Note that one instance of skSpectralLineShape may be shared between many different spectral lines.
storagebufferAn object created by this spectral line shape object that is used to cache information about the specific spectral line being processed. Access to the cached information must be thread safe using mutexes etc as it is possible that multiple threads processing multiple wavenumbers are accessing the cached object simultaneously.

Implements skSpectralLineShape.


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