skOpticalProperties  2.1
Public Member Functions | List of all members
skOpticalProperties_ConvolvedDiscreteWavelenCachedState Class Referenceabstract

#include <skconvolvedopticalproperties.h>

Inheritance diagram for skOpticalProperties_ConvolvedDiscreteWavelenCachedState:
skOpticalProperties skOpticalProperties_ConvolvedDiscreteWavelenCachedStateFixedFWHM

Public Member Functions

bool SetHighResOpticalProperties (skOpticalProperties *highresopticalproperties, skWavelengthToPSF_Table *measurementdetails, skOpticalProperty_AdditionalStateInfo *atmosphericstateinfo)
virtual bool GetTargetFWHM (double wavelen_nm, double *fwhm_nm) const =0
virtual bool SetAtmosphericState (skClimatology *neutralatmosphere, const GEODETIC_INSTANT &pt, bool *crosssectionschanged) override
 Sets the atmospheric state and location for calculating cross-sections, usually temperature, pressure and position. More...
virtual bool UpdateInternalClimatology (const GEODETIC_INSTANT &pt) override
virtual bool CalculateCrossSections (double wavenumber, double *absxs, double *extxs, double *scattxs, size_t threadindex) override
 Calculate cross-sections at the specified wave-number. More...
virtual bool CalculatePhaseMatrix (double wavenumber, double cosscatterangle, skRTPhaseMatrix *phasematrix, size_t threadindex) override
 Calculate the phase matrix at the specified wavenumber and scattering angle. More...
virtual bool IsScatterer () const override
 Returns true if this particles scatters radiation.
virtual bool IsAbsorber () const override
 Returns true if this particles absorbs radiation radiation.
- Public Member Functions inherited from skOpticalProperties
 skOpticalProperties ()
bool GetRotatedPhaseMatrix (double wavenum, double mu, double muprime, double dphi, skRTPhaseMatrix *rotatedmatrix, size_t threadindex)
 Returns the rotated phase matrix necessary for scattering. More...
void CheckCosineRange (double *mu)
bool IsDeltaFunctionForwardScatter () const
 Returns true if this cross-section has a delta function forward scatter element.
virtual bool CalculateCrossSectionsArray (const std::vector< double > &wavenumber, std::vector< double > *absxs, std::vector< double > *extxs, std::vector< double > *scattxs)
 Calculate cross-sections at the specified array of wave-numbers. More...

Detailed Description

A class that convolves a high resolution cross-section spectrum to a requested spectral resolution specified as the FWHM in nanometers. The class caches convolved cross-section data as a function of both atmospheric state and wavelength. This allows the class to work quite efficiently in Sasktran RT calculations where the atmopsheric state is rapidly changed as we process rays at different locations.

Most (all the ones we have) high resolution cross-sections are only a function of a few atmospheric parameters (eg. Temperature and Pressure) and we use class skOpticalProperty_AdditionalStateInfo and its descendants to convert atmospheric state parameters into a unique key. This class was the next generation of development after older class skOpticalProperties_Convolved.

This class compensates for the spectral resolution of the source, high resolution cross-sections by using a #skWavelengthToPSF_Table object. This object, which is automatically built into most of our measured high resolution cross-section tables, provides the spectral resolution of the source cross-sections as a functionof wavelength.

Caching of convolved Cross-sections
This class caches cross-sections for each new wavelength as well as atmospheric state. This generally improves performance as it will only execute the convolution if atmospheric state parameters (eg temperature) change after a call to SetAtmosphericState. The code works well if you have a limited set of discrete wavelengths (eg. less than a few thousand) but there are no hard limits on the maximum number. Note that our high resolution cross-sections, which are suitable for convolution, have the appropriate #skWavelengthToPSF_Table and skOpticalProperty_AdditionalStateInfo interfaces built into their respective classes through multiple inheritance.
Main Details
The class has two functions that differentiate it from other optical property classes,
  1. SetHighResOpticalProperties.
  2. GetTargetFWHM
An example
The Convolved cross-section optical properties are very similar to all other optical properties but here is small example showing how you set up the code to convolve the SCHIAMACHY BOGUMIL V4 O3 cross section to a fixed FWHM convolution. Note the class automatically adjusts for the changing resolution of the BOGUMIL cross-sections.
void example()
skOpticalProperties_O3_SciaBogumilV4* o3sciav4; // The high resolution cross-section
skOpticalProperties_ConvolvedDiscreteWavelenCachedStateFixedFWHM* o3conv; // The convolving optical properties
o3sciav4 = new skOpticalProperties_O3_SciaBogumilV4; // Create the high resolution optical properties
o3conv = new skOpticalProperties_ConvolvedDiscreteWavelenCachedStateFixedFWHM; // Create the convolving class
o3sciav4->AddRef(); // manage the lifetime of the high res cross-section
o3conv ->AddRef(); // manage the lifetime of the convolving class
o3conv ->SetHighResOpticalProperties( o3sciav4, o3sciav4, o3sciav4 ); // configure the convolver so it uses the Sciamachy high res cross-section
o3conv ->SetFWHM( 0.9 ); // configure the convolver so it convolves to a spectral resolution of 0.9 nm
MakeCrossectionVersusTemperatureArray( o3conv, "o3conv.txt"); // Use the convolving optical properties using standard skOpticalProperties intwerface.
o3sciav4->Release(); // Release the high res spectral object
o3conv->Release(); // Release the convolver object.
See Also

Member Function Documentation

bool skOpticalProperties_ConvolvedDiscreteWavelenCachedState::SetHighResOpticalProperties ( skOpticalProperties highresopticalproperties,
skWavelengthToPSF_Table *  measurementdetails,
skOpticalProperty_AdditionalStateInfo atmosphericstateinfo 

Function to define the source, high resolution cross-section data. Users will normal call this to define the high resolution source cross-section data to convolve. We have written many of the high resolution cross-section classes so that one instance of the class can be both the first and second parameter; in fact we recommend this technique as we dont do lifetime management on the #measurementdetails object.

[in]highresopticalpropertiesProvides access to the high resolution cross-section data. The lifetime of the object is managed by the class.
[out]measurementdetailsPointer to an object that can be used to get the spectral resolution of the source cross-section data as a function of wavelength. Note that the lifetime of this object is not managed. This is not that big an issue as it is normally the same object as #highresopticalproperties
True if successful.
virtual bool skOpticalProperties_ConvolvedDiscreteWavelenCachedState::GetTargetFWHM ( double  wavelen_nm,
double *  fwhm_nm 
) const
pure virtual

A purely virtual function that fetches the desired spectral resolution of the target convolution centered at the wavelength of interest. End users usually dont call this function as it automatically called when doing the convolution calculation. This function must be implemented in a derived class.

[in]wavelen_nmThe wavelength at the which the spectral resolution is required
[out]fwhm_nmReturns the spectral resolution at the desired wavelength as a FWHM in nanmeters.
True if successful.

Implemented in skOpticalProperties_ConvolvedDiscreteWavelenCachedStateFixedFWHM.

Referenced by CalculateCrossSections().

bool skOpticalProperties_ConvolvedDiscreteWavelenCachedState::SetAtmosphericState ( skClimatology *  neutralatmosphere,
bool *  crosssectionschanged 

Sets the atmospheric state and location for calculating cross-sections, usually temperature, pressure and position.

[NOT THREAD SAFE} Function that allows the optical properties class to update internal parameters in response to the caller changing geophysical location. This is provided so that radiative transfer models can manage cross-sections that depend upon pressure and temperature. The user (eg the radiative transfer model) will usually call SetAtmosphericState before calling CalculateCrossSections.

neutralatmosphereA climatology passed in by the user. The optical properties class can use this class if they wish to lookup parameters of interest. The climatology will usually support, pressure, temperature and density.
ptThe time and location at which the next set of cross-sections will be needed. Note that the height field in point will be valid (as this is often used to get the pressure and temperature).
crosssectionschangedreturns true if the new geophysical location will cause a change in cross-section. Several species (eg Rayleigh scattering) are completely unaffected by changes in location.

Implements skOpticalProperties.

References skOpticalProperties::SetAtmosphericState().

bool skOpticalProperties_ConvolvedDiscreteWavelenCachedState::UpdateInternalClimatology ( const GEODETIC_INSTANT &  pt)
Function that allows the optical properties class to update any internal
climatologies it may be using. This is useful for optical properties that use
internal climatologies to store various parameters (eg aerosols that store geographical distributions
of mode radius and mode width). The call to UpdateInternalClimatology differs from SetAtmosphericState
in its expected usage: a call to UpdateInternalClimatology configures internal climatologies so they
can quickly service the many subsequent calls to SetAtmosphericState.
ptThe time and location at which the next set of cross-sections will be needed. Note thatthe height field is usually ignored as all internal climatologies are expected to cache height profiles of their respective parameters.
True if success otherwise false.

Implements skOpticalProperties.

References skOpticalProperties::UpdateInternalClimatology().

bool skOpticalProperties_ConvolvedDiscreteWavelenCachedState::CalculateCrossSections ( double  wavenumber,
double *  absxs,
double *  extxs,
double *  scattxs,
size_t  threadindex 

Calculate cross-sections at the specified wave-number.

The main function of the class. The user calls this function so the optical properties object can
calculate and update its three cross-sections: absorption, scattering and extinction.
The user may fetch the calculated cross-sections  by calling #AbsorptionCrossSection, #ScatteringCrossSection

and #ExtinctionCrossSection.

There is no requirement that the class generate physically meaningful cross-sections where the sxtinction is the sum of the absorption and the scattering (although this will normally be the case)

Well-written classes will check that the user is not calling for a calculation under identical conditions.

wavenumberThe wavenumber (cm-1) at which the calculations are required.
absxsReturns the absorption cross-section in cm-2
extxsReturns the extinction cross-section in cm-2
scattxsReturns the scattering cross-section in cm-2
threadidPasses in the 0 based index of this thread. This is used by derived classes to store thread local storage. Default value is zero.
True if success otherwise false.

Implements skOpticalProperties.

References GetTargetFWHM().

bool skOpticalProperties_ConvolvedDiscreteWavelenCachedState::CalculatePhaseMatrix ( double  wavenumber,
double  cosscatterangle,
skRTPhaseMatrix phasematrix,
size_t  threadindex 

Calculate the phase matrix at the specified wavenumber and scattering angle.

Set the extinction, ansorption and scattering cross-sections.

Reimplemented from skOpticalProperties.

References skOpticalProperties::CalculatePhaseMatrix().

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