;+ ; NAME: ; approxwidth.pro ; PURPOSE: ; Calculate equivalent widths assuming appoximate forms of ; Doppler broadening, Lorentx broadening and Voigt profile. ; The equations are from Ch. 4 of Goody & Yung. ; DESCRIPTION: ; a function to help determine the approx. equivalent width ; of spectral lines. This was used to check widthv.pro and ; widtha.pro. ; CATEGORY: ; CALLING SEQUENCE: approxwidth, S, N, adop, aL, amf, Wd, Wl, Wv ; INPUTS: ; S -- strength of the line shape, given in cm^-1/(molecules*cm^-2) ; N -- Column abundance of molecules which cause the feature, ; given in molecules/cm^2. ; adop -- Doppler line shape, given in cm^-1 ; aL -- Lorentzian line shape, given in cm^-1 ; amf -- air mass factor ; OPTIONAL INPUT PARAMETERS: none ; KEYWORD PARAMETERS: ; OUTPUTS: ; Wd -- the approx. equivalent width using a Doppler profile. ; Wl -- the approx. equivalent width using a Lorentz profile. ; Wv -- the approx. equivalent width using a Voigt profile. ; SIDE EFFECTS: none ; RESTRICTIONS: ; PROCEDURE: ; Wd from Goody & Yung 4.20 ; MODIFICATION HISTORY: Written by Jason Cook, May 4, 1999, BU ; 2009 Nov 25 LAY, SwRI. ; Remove print statement, ; multiply by amf for optically-thin case ; replace !pi w/ sqrt(!pi) for w ; 2009 Dec 5 LAY ; change low-w doppler case from S*m for w<1 to ; Eq. 4.19 for w < 3. ;- function approxwidth, S, N, adop, aL, amf, Wd, Wl, Wv m = N * amf w=S*m/(adop*sqrt(!pi)) ;print, w ;if alog(w) lt 0 then begin if w lt .1 then begin sum = 1.d for i = 1d, 30 do sum += ((-1)^i)*(w^i)/(factorial(i)*sqrt(i)) Wd = sqrt(!pi) * w * adop * sum endif else begin if w lt 2.5 then begin ; 4.23 with al = 0 nu0 = 1.25 * adop Wd = 2*nu0*(1 - exp(-S*m/(2*nu0) ) ) endif else begin lnw = alog(w) Wd=2*adop* (lnw^(1/2.)+0.2886*lnw^(-1/2.)-0.2473*lnw^(-3/2.)+0.3403*lnw^(-5/2.)) endelse endelse u=S*m/(2*!pi*aL) ; Goody & Yung 4.8 L=u*(1+(!pi*u/2)^(5/4.))^(-2/5.) ; Goody & Yung 4.13 Wl=2*!pi*aL*L ; Goody & Yung 4.10 Wv=sqrt(Wl^2 + Wd^2 - (Wl*Wd/(S*m))^2 ) return, Wv end