srf
index
../src3/srf.py

srf  ---  spectral response functions
                                     a.k.a.
ils  ---  instrument line shape
 
Evaluate normalized srf/ils on a wavenumber grid
integral srf(v) dv = 1
 
usage:
srf  [options]  srfValue
 
* Gaussian etc response function:
  srfValue = width = HWHM = half width @ half maximum
* FTS (Fourier transform spectrometer):
  srfValue is interpreted as MOPD
  L = MOPD = maximum optical path difference
  the first zero is at 1/2L
  ===> hwhm = 1/4L approximately
 
-h               help
-c     char      comment character(s) used in output file (default '#')
-o     string    output file for saving of vGrid and srfValues
-t     string    type of spectral response function:
                 Gauss (default), Lorentz, Hyperbolic, Triangle, FTS
-a     char      apodization (for FTS only)
                 default no apodization, i.e. sinc
                 c       cosine
                 g       gaussian
                 q       quartic (Connes)
                 t|b     triangular / Bartlett
                 w|m|s   weak|medium|strong Norton-Beer
                 H       Hamming
                 h       Hanning
-s     int       sampling rate:  grid point spacing = delta = width/sample
                 default 5
-x     float     wavenumber grid extension in units of half widths
                 default 10.0

 
Functions
       
Gauss(vGrid, gamma=1.0)
Gauss profile normalized to one (gamma is HWHM).
HyperGauss(vGrid, gamma=1.0)
'hyper-Gauss' profile with power of six in the exponent normalized to one (gamma is HWHM).
Hyperbolic(vGrid, gamma=1.0)
Hyperbolic profile normalized to one (gamma is HWHM).
Lorentz(vGrid, gamma=1.0)
Lorentz profile normalized to one (gamma is HWHM).
Sinc(x)
SuperGauss(vGrid, gamma=1.0)
'super-Gauss' profile with power of four in the exponent normalized to one (gamma is HWHM).
Triangle(xGrid, hwhm=1.0)
Triangular profile normalized to one (the triangle goes from -2*hwhm to +2*hwhm).
fts(vGrid, mopd=1.0, apodize='', vShift=0.0, sigma=1.0)
Instrument Line Shape (spectral response function) for Fourier transform spectrometer.
Default:      ils = 2 mopd sinc(2 pi mopd v) = sin(2 pi mopd v)/(pi v) unapodized;
 
ARGUMENTS:
----------
vGrid:       wavenumber grid
mopd:        L = mopd = maximum optical path difference [cm]
apodize:     type of apodization function, default None, i.e. ILS = 2*L*sinc(2 pi L vGrid)
             triangle, cosine, weak|medium|strong Norton-Beer, Hamming, Hanning, quartic, Gaussian, ...
             In most cases case-insensitive, the first letter is sufficient (e.g. 't' for triangular)
             except for:
             "H"    Hamming
             "h"    hanning
vShift:      wavenumber shift (default 0.0)
sigma:       width for Gaussian apodization
 
RETURNS:
--------
ils:         a ndarray of response function values with size=len(vGrid)
 
REFERENCES:
-----------
Weisstein, Eric W. "Apodization Function." From MathWorld -- A Wolfram Web Resource.
    http://mathworld.wolfram.com/ApodizationFunction.html
R.H. Norton and C.P. Rinsland. New apodozing functions in Fourier spectrometry.
    J. Opt. Soc. Am., 66:259-264, 1976. doi: 10.1364/JOSA.66.000259.
R.H. Norton and R. Beer. Errata: New apodozing functions in Fourier spectrometry.
    J. Opt. Soc. Am., 67:419, 1977. doi: 10.1364/JOSA.67.000419.
gauss4quad(x)
# ... and the gaussian required for the integral defining the Gaussian apodization function, to be solved by quadpack
hamming(t)
Hamming instrument function for apodization (without the MOPD prefactor!).
hanning1(t)
Hanning instrument function for apodization (without the MOPD prefactor!).
hanning2(t)
Hanning instrument function for apodization (without the MOPD prefactor!).
srf(vGrid, srFunction='Gauss', value=1.0)
Evaluate spectral response function on given wavenumber grid and return array of data values.
 
vGrid:       wavenumber grid
srFunction:  name of the spectral reponse function (default Gauss)
             G = Gauss | L = Lorentz | H = Hyperbolic | T = Triangle | S = SuperGauss | HG = HyperGauss
             FTS = Fourier transform spectrometer  (apodization selected by second 'word' in this string)
value        hwhm OR mopd characterizing the spectral response function:
             hwhm (half width @ half maximum) [1/cm] of (super/hyper) Gauss / Lorentz / Hyperbolic / Triangle
             mopd (maximum optical path difference) [cm] of FTS
 
NOTE:        FTS default without apodization, i.e. sinc
             add a letter indicating type of apodization function, e.g. "FTS T" for triangular apodization
             (see function fts documentation)

cm0 = 0.152442
cm1 = -0.136176
cm2 = 0.983734
cos = <ufunc 'cos'>
cs0 = 0.045335
cs2 = 0.554883
cs4 = 0.399782
cw0 = 0.384093
cw1 = -0.087577
cw2 = 0.703484
ln2 = 0.6931471805599453
pi = 3.141592653589793
recGammaQuarter = 0.2758156628302093
recGammaSixth = 0.17965203550789732
recPi = 0.3183098861837907
sqrt2 = 1.4142135623730951
sqrtLn2 = 0.8325546111576977
sqrtPi = 1.7724538509055159
sqrtSqrtLn2 = 0.9124443057840285
 
Data