;+ ; NAME: ; OHM83 ; PURPOSE: ; To generate a synthetic spectrum of the OH M (8,3) band. ; CATEGORY: ; Synthetic spectra. ; CALLING SEQUENCE: ; OHM83,TEMP,HW,W1,Y [,PS=PS] [,INPUT=input] ; INPUTS: ; TEMP: The rotational temperature in Kelvins. ; HW: The emission line FWHM, in Angstroms. ; KEYWORD PARAMETERS: ; /PS: A PostScript plot of the synthetic spectrum will be ; generated. ; INPUT: If specified, contains the name of an alternate data ; file from which to read the wavelengths, line strengths, ; and rotational level energies. ; OUTPUTS: ; W1: A 1-d array containing the wavelengths of the spectrum ; in Angstroms. ; Y: A 1-d array containing the relative brightness of the ; spectrum, corresponding to the wavelengths contained in ; W1. ; COMMON BLOCKS: ; None. ; SIDE EFFECTS: ; A data file of spectral parameters is read. If the PS keyword is ; set, the file OH83WSF.PS is produced. ; RESTRICTIONS: ; The file ..../oh83wsf.chc (or any alternate file specified by ; the user) must exist, as it holds the rotational line ; wavelengths, oscillator strength, rotational term values, etc., ; that are needed to generate the synthetic spectrum. ; PROCEDURE: ; The data file is read. The 3rd-column data, giving the ; rotational level energies above the minimum, are used together ; with the specified rotational temperature to calculate the ; relative level populations from the Boltzmann distribution. The ; 2nd-column data give the Honl-London line strengths, and these, ; when multiplied by the 3rd power of the wavenumber difference ; between levels, approximate the relative transition ; probabilities of the various emissions. The spectral ; distribution over the appropriate wavelength range is generated ; on a finely spaced regular grid using the specified HW ; parameter, and the resulting distribution is plotted to the ; screen, and to a PS file if desired. ; MODIFICATION HISTORY: ; Modified July 19, 1994, by T A Oliynyk ; Modified and documented March 11, 1997 by DP Steele. ;- PRO ohm83,temp,hw,w1,y,ps=ps,input=input IF N_Params() NE 4 THEN BEGIN Doc_Library,'ohm83' Return ENDIF ; Locate the requested data file. path='c:\idl\synspec\' IF N_Elements(input) GT 0 $ THEN filename=path+input $ ELSE filename=path+'oh83wsf.chc' cf=RFindFile(filename,Count=ncf) IF ncf GE 1 THEN filename=cf(0) ELSE Begin Message,'Requested data file not found - '+filename,/Informational Return ENDELSE ; Read the data. d=DDRead(filename) w=d(0,*) s=d(1,*) f=d(2,*) ; Generate the amplitudes of the spectral lines. power=EXP((-1.4387893/temp)*f) ym=s*((10000./w)^3)*power ; Generate the wavelength grid to be output. w1=FINDGEN(6000)*0.1+7100 y=FLTARR(6000) I4=FIX(10.*hw) i1=FIX((w-7100.)*10.) i2=i1+i4 i3=i1-i4 FOR i=0,N_Elements(w)-1 DO BEGIN FOR j=i3(i),i2(i) DO BEGIN strt=j-i1(i) CASE 1 OF strt LT 0: y(j)=y(j)+ym(i)*(j-i3(i))/i4 strt EQ 0: y(j)=y(j)+ym(i) strt GT 0: y(j)=y(j)+ym(i)*(i2(i)-j)/i4 ELSE: ENDCASE ENDFOR ENDFOR nozero=WHERE(y) lower=MIN(nozero,MAX=upper) lower=w1(lower)-20 upper=w1(upper)+20 T=String(temp,Format='(F5.1)') halfmax=STRING(hw,FORMAT='(F4.2)') pt='OH M (8,3) Band, T!irot!n: '+T+'K, FWHM: '+halfmax+Angstrom()+', S-HL' PLOT,w1,y,TITLE=pt $ ,XTitle='Wavelength ('+Angstrom()+')',XRange=[lower,upper] $ ,YTitle='Intensity (arbitrary units)' rt=0.05*!X.CRange(0)+0.95*!X.CRange(1) up=0.05*!Y.CRange(0)+0.95*!Y.CRange(1) XYOuts,rt,up,filename,Alignment=1,/Data IF KEYWORD_SET(ps) THEN BEGIN psfilename=path+'oh83wsf.ps' psopen,psfilename PLOT,w1,y,TITLE=pt $ ,XTITLE='Wavelength ('+Angstrom()+')',XRANGE=[lower,upper] $ ,YTITLE='Intensity (arbitrary units)' XYOuts,rt,up,filename,Alignment=1,/Data psclose ENDIF Return END