;+ ; NAME: ; OHM62 ; PURPOSE: ; To generate a synthetic spectrum of the OH M (6,2) band. ; CATEGORY: ; Synthetic spectra. ; CALLING SEQUENCE: ; OHM62,TEMP,HW,W1,Y [,NOPLOT=noplot] [,PS=PS] [,INPUT=input] $ ; [,RANGE=range] ; INPUTS: ; TEMP: The rotational temperature in Kelvins. ; HW: The emission line FWHM, in Angstroms. ; KEYWORD PARAMETERS: ; /NOPLOT: If set, no plots are generated. This keyword overrides ; /PS. ; /PS: A PostScript plot of the synthetic spectrum will be ; generated, unless /NOPLOT is set. ; INPUT: If specified, contains the name of an alternate data ; file from which to read the wavelengths, line strengths, ; and rotational level energies. ; RANGE: A two-elements array that defines the wavelength range ; (Angstroms) to be shown in the plot(s). ; 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 OH62WSF.PS is produced. ; RESTRICTIONS: ; The file ..../oh62wsf.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 ohm62,temp,hw,w1,y,noplot=noplot,ps=ps,input=input,range=range IF N_Params() NE 4 THEN BEGIN Doc_Library,'ohm62' Return ENDIF ; Locate the requested data file. path='c:\idl\synspec\' IF N_Elements(input) GT 0 $ THEN filename=path+input $ ELSE filename=path+'oh62wsf.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+8200 x_style=(N_Elements(range) GT 0) IF N_Elements(range) LT 2 THEN range=[Min(w1,Max=wx),wx] y=FLTARR(6000) I4=FIX(10.*hw) i1=FIX((w-8200.)*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)>range(0) upper=(w1(upper)+20)