ARTS  2.2.66
lineshapes.cc File Reference

Stuff related to lineshape functions. More...

#include <cmath>
#include "arts.h"
#include "matpackI.h"
#include "array.h"
#include "absorption.h"
#include "Faddeeva.hh"
Include dependency graph for lineshapes.cc:

Go to the source code of this file.

Namespaces

 global_data
 

Functions

void lineshape_no_shape (Vector &ls_attenuation, Vector &ls_phase, Vector &X, const Numeric f0, const Numeric gamma, const Numeric sigma, ConstVectorView f_grid)
 
void lineshape_lorentz (Vector &ls_attenuation, Vector &ls_phase, Vector &X, const Numeric f0, const Numeric gamma, const Numeric sigma, ConstVectorView f_grid)
 
void lineshape_doppler (Vector &ls_attenuation, Vector &ls_phase, Vector &x, const Numeric f0, const Numeric gamma, const Numeric sigma, ConstVectorView f_grid)
 
long bfun6_ (Numeric y, Numeric x)
 
void lineshape_voigt_kuntz6 (Vector &ls_attenuation, Vector &ls_phase, Vector &x, const Numeric f0, const Numeric gamma, const Numeric sigma, ConstVectorView f_grid)
 
long int bfun3_ (Numeric y, Numeric x)
 
void lineshape_voigt_kuntz3 (Vector &ls_attenuation, Vector &ls_phase, Vector &x, const Numeric f0, const Numeric gamma, const Numeric sigma, ConstVectorView f_grid)
 
long bfun4_ (Numeric y, Numeric x)
 
void lineshape_voigt_kuntz4 (Vector &ls_attenuation, Vector &ls_phase, Vector &x, const Numeric f0, const Numeric gamma, const Numeric sigma, ConstVectorView f_grid)
 
void lineshape_voigt_drayson (Vector &ls_attenuation, Vector &ls_phase, Vector &x, const Numeric f0, const Numeric gamma, const Numeric sigma, ConstVectorView f_grid)
 
void chi_cousin (Numeric &chi, const Numeric &df)
 
void lineshape_CO2_lorentz (Vector &ls_attenuation, Vector &ls_phase, Vector &X, const Numeric f0, const Numeric gamma, const Numeric sigma, ConstVectorView f_grid)
 
void lineshape_CO2_drayson (Vector &ls_attenuation, Vector &ls_phase, Vector &X, const Numeric f0, const Numeric gamma, const Numeric sigma, ConstVectorView f_grid)
 
void faddeeva_algorithm_916 (Vector &ls_attenuation, Vector &ls_phase, Vector &xvector, const Numeric f0, const Numeric gamma, const Numeric sigma, ConstVectorView f_grid)
 
void hui_etal_1978_lineshape (Vector &ls_attenuation, Vector &ls_phase, Vector &xvector, const Numeric f0, const Numeric gamma, const Numeric sigma, ConstVectorView f_grid)
 
void lineshape_norm_no_norm (Vector &fac, const Numeric f0, ConstVectorView f_grid, const Numeric T)
 
void lineshape_norm_linear (Vector &fac, const Numeric f0, ConstVectorView f_grid, const Numeric T)
 
void lineshape_norm_quadratic (Vector &fac, const Numeric f0, ConstVectorView f_grid, const Numeric T)
 
void lineshape_norm_VVH (Vector &fac, const Numeric f0, ConstVectorView f_grid, const Numeric T)
 
void define_lineshape_data ()
 
void define_lineshape_norm_data ()
 

Detailed Description

Stuff related to lineshape functions.

This file contains both the lineshape functions themselves and the function define_lineshape_data which sets the lineshape lookup data.

This is the file from arts-1-0, back-ported to arts-1-1.

Author
Stefan Buehler
Date
2000-08-21

Definition in file lineshapes.cc.

Function Documentation

◆ bfun3_()

long int bfun3_ ( Numeric  y,
Numeric  x 
)

Definition at line 561 of file lineshapes.cc.

Referenced by lineshape_voigt_kuntz3().

◆ bfun4_()

long bfun4_ ( Numeric  y,
Numeric  x 
)

Definition at line 938 of file lineshapes.cc.

Referenced by lineshape_voigt_kuntz4().

◆ bfun6_()

long bfun6_ ( Numeric  y,
Numeric  x 
)

Definition at line 153 of file lineshapes.cc.

Referenced by lineshape_voigt_kuntz6().

◆ chi_cousin()

void chi_cousin ( Numeric chi,
const Numeric df 
)

Chi factors according to Cousin

The CO2-CO2 self-broadening is neglected. Broadening factors for both O2 and N2 are considered, assuming 79% N2 and 21% O2.

Parameters
chiOut: The chi factor
df(f-f0) in Hz.
Author
Patrick Eriksson
Date
2000-09-07

Definition at line 1558 of file lineshapes.cc.

References HZ2CM.

Referenced by lineshape_CO2_drayson(), and lineshape_CO2_lorentz().

◆ define_lineshape_data()

◆ define_lineshape_norm_data()

void define_lineshape_norm_data ( )

◆ faddeeva_algorithm_916()

void faddeeva_algorithm_916 ( Vector ls_attenuation,
Vector ls_phase,
Vector xvector,
const Numeric  f0,
const Numeric  gamma,
const Numeric  sigma,
ConstVectorView  f_grid 
)

The Voigt and Faraday-Voigt line shape. Based on rewritten Faddeeva function algorithm 916. For more information read: MOFREH R. ZAGHLOUL and AHMED N. ALI Algorithm 916: Computing the Faddeyeva and Voigt Functions ACM Transactions on Mathematical Software, Vol. 38, No. 2, Article 15, Publication date: December 2011.

The main bulk of code is in Faddeeva.cc and written by Steven G. Johnson of MIT. Keep Faddeeva.{cc,hh} up to date in speed and accuracy by watching: http://ab-initio.mit.edu/Faddeeva sometimes.

Return values
ls_attenuationThe shape function.
ls_phaseThe phase shape function.
xvectorAuxillary parameter to store frequency grid.
Parameters
f0Line center frequency.
gammaThe pressure broadening parameter.
sigmaThe Doppler broadening parameter.
f_gridThe frequency grid.
Author
Richard Larsson 2013-01-17

Definition at line 1699 of file lineshapes.cc.

References fac(), ConstVectorView::nelem(), PI, and w().

Referenced by define_lineshape_data().

◆ hui_etal_1978_lineshape()

void hui_etal_1978_lineshape ( Vector ls_attenuation,
Vector ls_phase,
Vector xvector,
const Numeric  f0,
const Numeric  gamma,
const Numeric  sigma,
ConstVectorView  f_grid 
)

The Voigt and Faraday-Voigt line shape. Based on Complex Error Function of X+i*Y.

Y must be positive.

Reference for equations: Hui, Armstrong and Wray, JQSRT V.19, P.509 (1978).


CERROR(z)=CERROR(x+iy)=CERROR(x,y)=w(x,y) g(nu,nu_0) = (1/DopHW)* sqrt(ln2/pi)*(Re(w(x,y) + Py*Im(w(x,y)) y=(P*LorHW /DopHW)*sqrt(ln2) x=(nu-nu_0)/DopHW)*sqrt(ln2)

NB Re(w)=Voigt

Return values
ls_attenuationThe shape function.
ls_phaseThe phase shape function.
xvectorAuxillary parameter to store frequency grid.
Parameters
f0Line center frequency.
gammaThe pressure broadening parameter.
sigmaThe Doppler broadening parameter.
f_gridThe frequency grid.
Author
P. Rosenkranz 1988-02-19

(Added by Richard Larsson 2014-03-13 with slight moderation)

Definition at line 1765 of file lineshapes.cc.

References C, fac(), ConstVectorView::nelem(), and PI.

Referenced by define_lineshape_data().

◆ lineshape_CO2_drayson()

void lineshape_CO2_drayson ( Vector ls_attenuation,
Vector ls_phase,
Vector X,
const Numeric  f0,
const Numeric  gamma,
const Numeric  sigma,
ConstVectorView  f_grid 
)

A CO2 IR line shape.

Return values
ls_attenuationThe shape function.
XAuxillary parameter, only used in Voigt fct.
Parameters
f0Line center frequency.
gammaThe pressure broadening parameter.
sigmaThe Doppler broadening parameter. (Not used.)
f_gridThe frequency grid.
Author
Patrick Eriksson
Date
2000-09-04

Definition at line 1651 of file lineshapes.cc.

References chi_cousin(), lineshape_voigt_drayson(), and ConstVectorView::nelem().

Referenced by define_lineshape_data().

◆ lineshape_CO2_lorentz()

void lineshape_CO2_lorentz ( Vector ls_attenuation,
Vector ls_phase,
Vector X,
const Numeric  f0,
const Numeric  gamma,
const Numeric  sigma,
ConstVectorView  f_grid 
)

A CO2 IR line shape.

Return values
ls_attenuationThe shape function.
XAuxillary parameter, only used in Voigt fct.
Parameters
f0Line center frequency.
gammaThe pressure broadening parameter.
sigmaThe Doppler broadening parameter. (Not used.)
f_gridThe frequency grid.
Author
Patrick Eriksson
Date
2000-09-04

Definition at line 1607 of file lineshapes.cc.

References chi_cousin(), fac(), ConstVectorView::nelem(), and PI.

Referenced by define_lineshape_data().

◆ lineshape_doppler()

void lineshape_doppler ( Vector ls_attenuation,
Vector ls_phase,
Vector x,
const Numeric  f0,
const Numeric  gamma,
const Numeric  sigma,
ConstVectorView  f_grid 
)

The Doppler line shape.

Return values
ls_attenuationThe shape function.
ls_phaseThe shape function.
xAuxillary parameter, only used in Voigt fct.
Parameters
f0Line center frequency.
gammaThe pressure broadening parameter. (Not used.)
sigmaThe Doppler broadening parameter.
f_gridThe frequency grid.
Author
Axel von Engeln
Date
2000-12-06

Definition at line 123 of file lineshapes.cc.

References fac(), ConstVectorView::nelem(), and PI.

Referenced by define_lineshape_data().

◆ lineshape_lorentz()

void lineshape_lorentz ( Vector ls_attenuation,
Vector ls_phase,
Vector X,
const Numeric  f0,
const Numeric  gamma,
const Numeric  sigma,
ConstVectorView  f_grid 
)

The Lorentz line shape. This is a quick and dirty implementation.

Return values
ls_attenuationThe shape function.
ls_phaseThe shape function.
XAuxillary parameter, only used in Voigt fct.
Parameters
f0Line center frequency.
gammaThe pressure broadening parameter.
sigmaThe Doppler broadening parameter. (Not used.)
f_gridThe frequency grid.
Author
Stefan Buehler
Date
2000-06-16

Definition at line 86 of file lineshapes.cc.

References fac(), ConstVectorView::nelem(), and PI.

Referenced by define_lineshape_data().

◆ lineshape_no_shape()

void lineshape_no_shape ( Vector ls_attenuation,
Vector ls_phase,
Vector X,
const Numeric  f0,
const Numeric  gamma,
const Numeric  sigma,
ConstVectorView  f_grid 
)

The dummy line shape. This lineshape does nothing. It only exists, because formally you have to specify a lineshape also for continuum tags. It has to have the same arguments as all the other lineshapes, though...

Return values
ls_attenuationThe shape function.
ls_phaseThe shape function.
XAuxillary parameter, only used in Voigt fct.
Parameters
f0Line center frequency.
gammaThe pressure broadening parameter.
sigmaThe Doppler broadening parameter. (Not used.)
f_gridThe frequency grid.
Exceptions
runtime_errorThis exception is always thrown when the function is called.
Date
2001-01-16
Author
Stefan Buehler

Definition at line 60 of file lineshapes.cc.

Referenced by define_lineshape_data().

◆ lineshape_norm_linear()

void lineshape_norm_linear ( Vector fac,
const Numeric  f0,
ConstVectorView  f_grid,
const Numeric  T 
)

Linear normalization factor of the lineshape function with f/f0.

Return values
facNormalization factor to the lineshape function.
Parameters
f0Line center frequency.
f_gridThe frequency grid.
T(unused here)
Author
Axel von Engeln 30.11.2000

Definition at line 1839 of file lineshapes.cc.

References abs, and ConstVectorView::nelem().

◆ lineshape_norm_no_norm()

void lineshape_norm_no_norm ( Vector fac,
const Numeric  f0,
ConstVectorView  f_grid,
const Numeric  T 
)

No normalization of the lineshape function.

Return values
facNormalization factor to the lineshape function.
Parameters
f0Line center frequency.
f_gridThe frequency grid.
TTemperature (unused here)
Author
Axel von Engeln 30.11.2000

Definition at line 1821 of file lineshapes.cc.

Referenced by define_lineshape_norm_data().

◆ lineshape_norm_quadratic()

void lineshape_norm_quadratic ( Vector fac,
const Numeric  f0,
ConstVectorView  f_grid,
const Numeric  T 
)

Quadratic normalization factor of the lineshape function with (f/f0)^2.

Return values
facNormalization factor to the lineshape function.
Parameters
f0Line center frequency.
f_gridThe frequency grid.
TTemperature (unused here)
Author
Axel von Engeln 30.11.2000

Definition at line 1863 of file lineshapes.cc.

References ConstVectorView::nelem().

Referenced by define_lineshape_norm_data().

◆ lineshape_norm_VVH()

void lineshape_norm_VVH ( Vector fac,
const Numeric  f0,
ConstVectorView  f_grid,
const Numeric  T 
)

Van Vleck Huber normalization factor of the lineshape function with (f*tanh(h*f/(2*k*T))) / (f0*tanh(h*f0/(2*k*T))). The denominator is a result of catalogue intensities. See P. Rayer, The VVH and VVW Spectral Functions, Atmospheric Millimeter and Sub-Millimeter Wave Radiative Transfer Modeling II, Editors: P. Eriksson, S. Buehler, Berichte aus derm Institut fuer Umweltphysik, Band 4, 2001.

Return values
facNormalization factor to the lineshape function.
Parameters
f0Line center frequency.
f_gridThe frequency grid.
TTemperature
Author
Axel von Engeln 2003-07-28

Definition at line 1893 of file lineshapes.cc.

References abs, BOLTZMAN_CONST, ConstVectorView::nelem(), and PLANCK_CONST.

Referenced by define_lineshape_norm_data().

◆ lineshape_voigt_drayson()

void lineshape_voigt_drayson ( Vector ls_attenuation,
Vector ls_phase,
Vector x,
const Numeric  f0,
const Numeric  gamma,
const Numeric  sigma,
ConstVectorView  f_grid 
)

The Voigt line shape. Drayson approximation of the Voigt line shape.

Return values
ls_attenuationThe shape function.
xAuxillary parameter to store frequency grid.
Parameters
f0Line center frequency.
gammaThe pressure broadening parameter.
sigmaThe Doppler broadening parameter.
f_gridThe frequency grid.

Original ife function call and documention:

int voigt_vector(int nx, Numeric *X, Numeric Y, Numeric *Z, Numeric fac)

direct translation of the FORTRAN algorithm given in Drayson, S. R., Rapid Computation of the Voigt Profile, J. Quant. Spectrosc. Radiat. Transfer, Vol. 16, pp. 611-614, 1976 by Bjoern-Martin Sinnhuber, 13.Mar.96 in Ny-Aalesund, Spitsbergen.

Modified for vector calculation of a frequency array:

  --------------------------------------------------------------------
          int    nx        (in)           number of frequencies
          double *X        (in)           distance from line center in 
                                          units of (Doppler halfwidths 
                                          times sqrt(ln 2) )
          double  Y        (in)           Ratio of the collision halfwidth 
                                          to the ( Doppler halfwidth times sqrt(ln2) )
          double *Z        (out)          return array of voigt 
          double fac       (in)           no function, included to be
                                          consistent with the other voigt
                                          profile calculations
  --------------------------------------------------------------------

23.02.98 AvE

Replaced nx by nf, Z by ls, X by x, and multiplied ls with the factor fac.

Author
Axel von Engeln
Date
2000-12-06

Definition at line 1408 of file lineshapes.cc.

References C, fac(), N, ConstVectorView::nelem(), and PI.

Referenced by define_lineshape_data(), and lineshape_CO2_drayson().

◆ lineshape_voigt_kuntz3()

void lineshape_voigt_kuntz3 ( Vector ls_attenuation,
Vector ls_phase,
Vector x,
const Numeric  f0,
const Numeric  gamma,
const Numeric  sigma,
ConstVectorView  f_grid 
)

The Voigt line shape. Kuntz approximation of the Voigt line shape.

Return values
ls_attenuationThe shape function.
xAuxillary parameter to store frequency grid.
Parameters
f0Line center frequency.
gammaThe pressure broadening parameter.
sigmaThe Doppler broadening parameter.
f_gridThe frequency grid.

Original c function call and documention:

int voigt3 ( long nx, float *x, float y, float *prb, float fak )

Calculates the Voigt-Function times the user-definied value fac with a relative accuracy better than 2*10-3.

If this subroutine is called several times with the same parameter y the numerically expensive coefficents a1..t8 are only calculated once thus further accelerating the algorithm

  --------------------------------------------------------------------
  x(nx)   (in)    :Distance from line center in units of Doppler
                  :halfwidths
  y       (in)    :Ratio of the Doppler halfwidth to the Lorentz
                  :halfwidth  
  prb     (out)   :voigt-function times fak
  fak     (in)    :factor to be specified by the user
  --------------------------------------------------------------------

  author: M. Kuntz, 
          Institut fuer Meteorologie und Klimaforschung, 
          Forschungszentrum Karlsruhe, 
          Postfach 3640, 
          76021 Karlsruhe, Germany. 
          email: kuntz@imk.fzk.de 

About 'voigt3' : The program was originally written by M. Kuntz in Fortran77 but has been translated into C by Dietrich Feist (f2c) and into C++ by Oliver Lemke and Axel von Engeln. fak is removed from program code. Replaced nx by nf. Replaced prb by ls. Multiplied ls with the factor fac.

Author
Oliver Lemke and Axel von Engeln
Date
2000-12-07

Definition at line 650 of file lineshapes.cc.

References b0, bfun3_(), fac(), max, min, ConstVectorView::nelem(), and PI.

Referenced by define_lineshape_data().

◆ lineshape_voigt_kuntz4()

void lineshape_voigt_kuntz4 ( Vector ls_attenuation,
Vector ls_phase,
Vector x,
const Numeric  f0,
const Numeric  gamma,
const Numeric  sigma,
ConstVectorView  f_grid 
)

The Voigt line shape. Kuntz approximation of the Voigt line shape.

Return values
ls_attenuationThe shape function.
xAuxillary parameter to store frequency grid.
Parameters
f0Line center frequency.
gammaThe pressure broadening parameter.
sigmaThe Doppler broadening parameter. (Not used.)
f_gridThe frequency grid.

Original c function call and documention:

int voigt4 ( long nx, float *x, float y, float *prb, float fak )

Calculates the Voigt-Function times the user-definied value fac with a relative accuracy better than 2*10-4.

If this subroutine is called several times with the same parameter y the numerically expensive coefficents a1..t8 are only calculated once thus further accelerating the algorithm

  --------------------------------------------------------------------
  x(nx)   (in)    :Distance from line center in units of Doppler
                  :halfwidths
  y       (in)    :Ratio of the Doppler halfwidth to the Lorentz
                  :halfwidth  
  prb     (out)   :voigt-function times fak
  fak     (in)    :factor to be specified by the user
  --------------------------------------------------------------------

  author: M. Kuntz, 
          Institut fuer Meteorologie und Klimaforschung, 
          Forschungszentrum Karlsruhe, 
          Postfach 3640, 
          76021 Karlsruhe, Germany. 
          email: kuntz@imk.fzk.de 

About 'voigt4' : The program was originally written by M. Kuntz in Fortran77 but has been translated into C by Dietrich Feist (f2c) and into C++ by Oliver Lemke and Axel von Engeln. fak is removed from program code. Replaced nx by nf. Replaced prb by ls. Multiplied ls with the factor fac.

Author
Oliver Lemke and Axel von Engeln
Date
2000-12-07

Definition at line 1024 of file lineshapes.cc.

References b0, bfun4_(), fac(), max, min, ConstVectorView::nelem(), and PI.

Referenced by define_lineshape_data().

◆ lineshape_voigt_kuntz6()

void lineshape_voigt_kuntz6 ( Vector ls_attenuation,
Vector ls_phase,
Vector x,
const Numeric  f0,
const Numeric  gamma,
const Numeric  sigma,
ConstVectorView  f_grid 
)

The Voigt line shape. Kuntz approximation of the Voigt line shape.

Return values
ls_attenuationThe shape function.
xAuxillary parameter to store frequency grid.
Parameters
f0Line center frequency.
gammaThe pressure broadening parameter.
sigmaThe Doppler broadening parameter.
f_gridThe frequency grid.

Original c function call and documention:

int voigt ( long nx, float *x, float y, float *prb, float fak )

Calculates the Voigt-Function times the user-definied value fac with a relative accuracy better than 2*10-6.

If this subroutine is called several times with the same parameter y the numerically expensive coefficents a1..t8 are only calculated once thus further accelerating the algorithm

  --------------------------------------------------------------------
  x(nx)   (in)    :Distance from line center in units of Doppler
                  :halfwidths
  y       (in)    :Ratio of the Doppler halfwidth to the Lorentz
                  :halfwidth  
  prb     (out)   :voigt-function times fak
  fak     (in)    :factor to be specified by the user
  --------------------------------------------------------------------

  author: M. Kuntz, 
          Institut fuer Meteorologie und Klimaforschung, 
          Forschungszentrum Karlsruhe, 
          Postfach 3640, 
          76021 Karlsruhe, Germany. 
          email: kuntz@imk.fzk.de 

About 'voigt' : The program was originally written by M. Kuntz in Fortran77 but has been translated into C by Dietrich Feist (f2c) and into C++ by Oliver Lemke and Axel von Engeln. fak is removed from program code. Replaced nx by nf. Replaced prb by ls. Multiplied ls with the factor fac.

Author
Oliver Lemke and Axel von Engeln
Date
2000-09-27

Definition at line 236 of file lineshapes.cc.

References bfun6_(), fac(), max, min, ConstVectorView::nelem(), and PI.

Referenced by define_lineshape_data().