; NAME: ; OHLINES ; ; PURPOSE: ; This function makes OH lines from a database ; ; CALLING SEQUENCE: ; Result = OHLINES(wavl) ; ; INPUTS: ; Wavl = The array of wavelength locations (in meters) ; (range 0.5 microns to 2.0) ; OHLoc = The location of the oh line database ; ; OUTPUT: ; A spectrum with lines from the OH database ; (in photons*s-1*m-2*arcsec-2) ; ; PROCEDURE: ; Calculate the range, make a list from the database. ; ; MODIFICATION HISTORY: ; created June 22 2003 by John Dermody function OHLINES, wavl, ohloc=ohloc ; initialize variables. if not keyword_defined(ohloc) then begin ohloc = file_which('ohsky/database.txt') endif nwavl = n_elements(wavl) ; number of wavelengths wavla = wavl * 1.e10 ; conver wavl to angstroms swavela = wavla[0] ; start wavelength (A) ewavela = wavla[nwavl-1] ; end wavelegth (A) ; set up the data to be read if not file_test(ohloc) then message, 'OH Database missing; ' + ohloc ohdatafile = parsetab(rdasctab(ohloc)) i = where ( ohdatafile[0,*] eq 'OH' $ and ohdatafile[1,*] eq 'Skylines') dashloc = where(ohdatafile eq '-') ; change missing data to 0s ohdatafile[dashloc] = '0' ohdata = float(ohdatafile[3 : 5, i + 1 : *]) ; make a list of all lines with positions between swavela and ewavela lineloc = where((ohdata[0,*] gt swavela) and (ohdata[0,*] lt ewavela)) if (lineloc eq [-1]) then return, 0 ohdata = ohdata[*,lineloc] ; limit it to lines with height and width greater than 0. lineloc = where((finite(ohdata[2,*]) ge 0.) and (finite(ohdata[1,*]) ge 0.)) if (lineloc eq [-1]) then return, 0 ohdata = ohdata[*,lineloc] ; convert wavelengths to subscripts cnvt = (nwavl - 1) / (ewavela - swavela) ohdata[0,*] = (ohdata[0,*] - swavela) * cnvt ohdata[1,*] = ohdata[1,*] * cnvt return, ohdata end