pro ch_voigt, a, u, vgt, dis, vgtda, vgtdu, disda, disdu ;+ ; NAME: CH_VOIGT ; Purpose: ; Calculate the values of the Voigt function and its associated dispersion function, ; and their partial derivatives ; Calling sequence ; ; ch_voigt, a, u, vgt, dis, vgtda, vgtdu, disda, disdu ; ; Inputs: ; a damping parameter(s) ; u dimensionless wavelength offset(s) ; Outputs ; vgt the Voigt function value ; dis the associated dispersion function value ; Optional outputs ; vgtda a-derivative of the Voigt function ; vgtdu u-derivative of the Voigt function ; disda a-derivative of the dispersion function ; disdu u-derivative of the dispersion function ; History ; 2007 July: J. Chae first coded with the help of T. Yokoyama ; - common cch_voigt, a0, a1, a2,a3, a4,a5,a6,b0,b1,b2,b3, b4, b5,b6 if n_elements(a0) eq 0 then begin a0=122.607931777104326d0 a1=214.382388694706425d0 a2=181.928533092181549d0 a3= 93.155580458138441d0 a4=30.180142196210589d0 a5=5.912626209773153d0 a6= .564189583562615d0 b0=122.60793177387535d0 b1=352.730625110963558d0 b2=457.334478783897737d0 b3=348.703917719495792d0 b4=170.354001821091472d0 b5=53.992906912940207d0 b6=10.479857114260399d0 endif z=dcomplex(a, -u) num=(((((a6*z+a5)*z+a4)*z+a3)*z+a2)*z+a1)*z+a0 den =((((((z+b6)*z+b5)*z+b4)*z+b3)*z+b2)*z+b1)*z+b0 fz=num/den vgt=real_part(fz) dis=imaginary(fz) if n_params() ge 5 then begin numdz = ((((6*a6*z+5*a5)*z+4*a4)*z+3*a3)*z+2*a2)*z+a1 dendz = (((((7*z+6*b6)*z+5*b5)*z+4*b4)*z+3*b3)*z+2*b2)*z+b1 fzdz =numdz/den -num*dendz/den^2 vgtda = real_part(fzdz) vgtdu = imaginary(fzdz) disda =vgtdu disdu = - vgtda endif end