pro rjacoby,w,f ; IDL procedure to read and plot spectra ; from the library of Jacoby et al. 1984, ApJS, 56, 257 ; written by Doug Gies (8-22-2005) ; Input: ; /nfs/morgan4/gies/public_html/ASTR8000/stars.dat ; /nfs/morgan4/gies/public_html/ASTR8000/fluxes.dat ; Output: ; w = wavelength vector ; f = flux vector ; Instructions: ; Select star from list openr,1,'/nfs/morgan4/gies/public_html/ASTR8000/stars.dat' ns=161 ; number of stars in catalog aa=strarr(ns) for i=0,ns-1 do begin a=' ' readf,1,a aa(i)=strmid(a,0,28) print,i,aa(i) endfor close,1 starnum=0 read,' Star number to plot = ',starnum ; set up output vectors nw=2799 ; total number of points in spectrum w=dindgen(nw)*1.4d + 3510.d ; wavelength vector f=dblarr(nw) ; flux vector ; open and read the input file openr,1,'/nfs/morgan4/gies/public_html/ASTR8000/fluxes.dat' ; opens and assigns file to unit 1 ; skip down to selected star if (starnum gt 0) then begin for jstar=0,starnum-1 do begin for iline=0,399 do readf,1,a endfor endif ; read in fluxes for selected star d=dblarr(7) ; temporary array for each line of input for i=0,398 do begin ; typical do loop readf,1,a,d,format='(a10,7e10.3)' ; read in a line of values f(i*7)=d ; assign seven flux points at associated indices endfor ; end loop d=dblarr(6) ; special case for last line where there are only 6 input numbers readf,1,a,d,format='(a10,6e10.3)' f(399*7)=d close,1 ; close out the input file ; Create a PostScript plot set_plot,'ps' ; IDL redirects graphics from screen (x) to a PostScript file (ps) device,filename='jacoby.ps',/landscape ; name and set orientation of PostScript file !p.font=0 ; use resident fonts in printer !x.thick=2 ; thicker lines !y.thick=2 !p.thick=2 !p.charsize=1.5 ; slightly larger character size in titles plot,w,f,title='!3'+aa(starnum),xrange=[w(0),w(nw-1)],xstyle=1,$ ; $ means continue on next line xtitle='!3 WAVELENGTH (Angstroms)',ytitle='!3 FLUX (erg cm!U-2!N s!U-1!N Angstrom!U-1!N)' device,/close ; close the PS file set_plot,'x' ; revert back to terminal graphics output ; some helpful commands to appear on the screen: print,' To view output type: $gv jacoby.ps &' print,' (under "Landscape" button, select "Swap Landscape")' print,' To print output type: $lpr -Pcopier jacoby.ps' print,' To plot spectrum on screen type: plot,w,f,xrange=[3000,8000]' return end