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

#include <skabsorptiontable.h>

Inheritance diagram for skOpticalProperties_UserDefinedAbsorption:
skOpticalProperties skOpticalProperties_NO2_Burrows98 skOpticalProperties_NO2_OSIRISRes skOpticalProperties_O3_BassPaur skOpticalProperties_O3_DaumontBrionMalicet skOpticalProperties_O3_FTSVoigt skOpticalProperties_O3_GomeBurrows skOpticalProperties_O3_OSIRISRes skOpticalProperties_O3_SciaBogumilV3 skOpticalProperties_O3_SciaBogumilV4 skOpticalProperties_O3_SerdyuchenkoV1

Public Member Functions

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 CalculateCrossSections (double wavenumber, double *absxs, double *extxs, double *scattxs, size_t threadindex) override
 Calculate cross-sections at the specified wave-number. 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.
virtual bool UpdateInternalClimatology (const GEODETIC_INSTANT &pt) override
- 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...
virtual bool CalculatePhaseMatrix (double wavenumber, double cosscatterangle, skRTPhaseMatrix *phasematrix, size_t threadindex)
 Calculate the phase matrix at the specified wavenumber and scattering angle. More...

Protected Member Functions

bool AddEntry (double t, double *nm, int nmstride, double *xs, int xsstride, int npts)
bool DeepCopyWithoutTables (const skOpticalProperties_UserDefinedAbsorption &other)

Detailed Description

Base class for molecules or particles that are either purely absorbing or purely scattering and have the cross-sections expressed in tables as a function of wavelength and temperature.The code was upgraded in July 2012 to account for the DBM O3 cross-sections which have different wavelength coverage for different temperatures.

Cross-sections are provided as a table of wavelength versus cross-section for each temperature. The tables are normally stored in a derived class. Only one table per temperature should be used. Each wavelength/cross-section table is assumed to be contiguous from the first to last wavelength and is linearly interpolated. The code will return an error if the user tries to get a cross-section at a wavelength outside the range of wavelengths of any of the wavelength/cross-section tables.

As an example the Daumont Brion Malicet (DBM) O3 tables consist of 5 temperature tables (218K, 228K, 243K, 273K and 295K). The 218K table extends from 194.50 nm to 650 nm. The 3 tables 228K, 243K and 273K tables have a shorter range from 194.5nm to 520 nm. The last table, 295K, extends from 195 nm to 830 nm. When the user supplies a temperature and wavelength the code determines which of the 5 temperature tables span the selected wavelength and from this selection chooses the temperature tables just hotter and just colder than the desired temperature. Cross-sections are then linearly interpolated in wavelength and temperature.

Wavelength interpolation will only interpolate: it will not extrapolate beyond the table. Thus if none of the temperature tables have any entries that span the desired wavelength then the code will return a fail status. On the other hand if only one of the temperature tables has entries that span the selected wavelength then it will be used regardless of the incoming temperature. For example asking for cross-sections at 750 nm from the DBM O3 at any temperature will always return the same cross-section as only the 295K table spans this wavelength.

Temperature interpolation is linear when multiple temperature tables are available for a given wavelength and truncates out-of-range temperatures to the nearest valid table. This is reasonable behaviour for most atmospheric applications as temperature variations in cross-sections are small and the number of cross-sections measurements with temperature are limited and may not fully span the range of temepratures encountered in the atmosphere.

Developers should ensure that temperature tables (typically in derived classes) are added in ascending temperature order. I dont think it actually needs this but I have never tested anything but this. The cross-sections and corresponding wavelengths (in nanometers) for each temperature setting must be specified in ascending order (the class will not accept wavelength data that are not in ascending order).

Member Function Documentation

bool skOpticalProperties_UserDefinedAbsorption::AddEntry ( double  t,
double *  nm,
int  nmstride,
double *  xs,
int  xsstride,
int  npts 

Add this cross-section data to the list of entries. The entries are sorted into ascending temperature. I have assumed that this activity is carfeully done inside a constructor and have not checked to see if the entry for this temperature already exists

Referenced by skOpticalProperties_O3_SciaBogumilV4::skOpticalProperties_O3_SciaBogumilV4().

bool skOpticalProperties_UserDefinedAbsorption::DeepCopyWithoutTables ( const skOpticalProperties_UserDefinedAbsorption other)

Copies over the object without the tables

bool skOpticalProperties_UserDefinedAbsorption::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.

bool skOpticalProperties_UserDefinedAbsorption::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.

virtual bool skOpticalProperties_UserDefinedAbsorption::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.

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