pro atlas ; ;------------------ ; ATLAS PROCEDURE ;--------------- ; PURPOSE: TO READ AS INPUT A SET OF SOLAR ATLASES ; EXTRACT A PIECE OF THE ATLAS AND OUTPUT IT ; TO THE SCREEN(ASCII), PLOTS(SCREEN),CREATE AN ASCII TABLE FILE, ; OR CREATE A POSTSCRIPT FILE (default name is idl.ps) TO BE ; PRINTED OUT ;------------------------------- ; ans=string(1) ofile=string(40) atype=0 nplots=4 npts=1000 ; ; LIST CURRENT ATLASES AVAILABLE ; START: print,'THE CURRENT SOLAR ATLASES AVAILABLE' print,'-----------------------------------' print,' 1------FTSC' print,' 2------AFGL' print,' 3------SACPEAK' print,' 4------KFBT - KURUCZ, FURENLID, BRAULT, AND TESTERMAN' read,'ATYPE= ',atype if(atype lt 1 or atype gt 4) then goto,NEND ; ; ATLAS LOADING SECTION ; if(atype eq 1) then begin alab='FTSC' wls=1.0d wlf=wls ymin=0. ymax=1.2 restore,'./atlas_ftsc.sav' print,'***NOTE THERE ARE ',n_elements(x),' WL AND FLUXES IN THIS ATLAS' print,'WAVELENGTH(min,max)=',min(x),max(x) print,'-------------------' read,'What Starting and Ending Wavelength ? ',wls,wlf nt=n_elements(x) wlsp=where( x ge wls and x le wlf) wf=x(wlsp) inten=y(wlsp) endif if(atype eq 2) then begin alab='UVAFGL' wls=1.0 wlf=wls restore,'./atlas_afgl.sav' x=w y=f ymin=min(y) ymax=max(y) print,'***NOTE THERE ARE ',n_elements(x),' WL AND FLUXES IN THIS ATLAS' print,'WAVELENGTH(min,max)=',min(x),max(x) print,'-------------------' read,'What Starting and Ending Wavelength ? ',wls,wlf nt=n_elements(x) wlsp=where( x ge wls and x le wlf) wf=x(wlsp) inten=y(wlsp) endif if(atype eq 3) then begin alab='SAC PEAK' wls=1.0 wlf=wls ymin=0. ymax=1.2 REDO: print,'***NOTE THERE ARE 640000 WL and I in this ATLAS **' print,' FOR EACH .1 NM STEP THERE ARE 200 values' print,' WAVELENGTH(min,max)= 380.0 699.9' print,'------------ ' read,'What Starting and Ending Wavelength ? ',wls,wlf rdsacpeak,wls,wlf,wf,inten,ierr if(ierr lt 0) then goto,REDO endif if(atype eq 4) then begin alab='KFBT' wls=1.0 wlf=wls restore,'atlas_kfbt.sav' ymin=0. ymax=1.0 xmin=kfbt_wl_min xmax=kfbt_wl_max print,'***NOTE THERE ARE ',kfbt_number,' WL AND FLUXES IN THIS ATLAS' print,'WAVELENGTH(min,max)=',xmin,xmax print,'-------------------' read,'What Starting and Ending Wavelength ? ',wls,wlf nt=kfbt_number wlsp=where( kfbt_wl ge wls and kfbt_wl le wlf) wf=kfbt_wl(wlsp) inten=kfbt_rf(wlsp) endif nsp=n_elements(wf) CONT: ; ; OPTIONS FOR OUTPUT SECTION ; opt=0 print,alab,' SPECTRAL ATLAS MENU ' print,'-------------------------' print,' 0---NONE of the BELOW print,' 1---print results to screen' print,' 2---create ASCII file' print,' 3---plots on screen' print,' 4---hardcopy of plots **SPAWNS lp idl.ps for you** ' read,' SELECTION= ',opt if(opt lt 1 or opt gt 4) then goto,NEND if(opt eq 1) then begin print,alab,' ATLAS SECTION, WL(STARTING,ENDING)=',wls,wlf print,'-------------------------------------------------' for i=0L,nsp-1 do begin print,wf(i),inten(i) endfor endif if(opt eq 2) then begin read,'NAME OF ASCII FILE to be CREATED > ',ofile openw,1,ofile printf,1,alab,' ATLAS SECTION, WL(STARTING,ENDING)=',wls,wlf printf,1,'-------------------------------------------------' printf,1,' WAVELENGTH FLUXES printf,1,' -------------- -------- for i=0L,nsp-1 do begin printf,1,wf(i),inten(i) endfor close,1 endif if(opt eq 3) then begin set_plot,'X' ;set_plot,'tek' !P.MULTI=[0,0,nplots,0,0] pf=npts-1 nf=0 for i=0L,nsp-1,npts do begin if(nsp-1 lt pf) then pf=nsp-1 if(pf-i gt 1) then begin plot,wf(i:pf),inten(i:pf),TITLE=string(alab,' SPECTRAL ATLAS'),$ xtitle='wavelength',ytitle='FLUX',$ xrange=[wf(i),wf(pf)],xstyle=1,$ yrange=[ymin,ymax],ystyle=1 endif pf=pf+npts nf=nf+1 if(nf eq nplots) then begin read,'FRAME PAUSE--To CONTINUE PRESS RETURN > ',ans nf=0 endif endfor read,'To ERASE PLOT and CONTINUE PRESS RETURN > ',ans wdelete,0 endif if(opt eq 4) then begin set_plot,'ps' device,/inches,xsize=7,ysize=10,yoffset=0.5 !P.MULTI=[0,0,nplots,0,0] pf=npts-1 for i=0L,nsp-1,npts do begin if(nsp-1 lt pf) then pf=nsp-1 if(pf-i gt 1) then begin plot,wf(i:pf),inten(i:pf),TITLE=string(alab,' SPECTRAL ATLAS'),$ xtitle='wavelength',ytitle='FLUX',$ xrange=[wf(i),wf(pf)],xstyle=1,$ yrange=[ymin,ymax] endif pf=pf+npts endfor device,/close spawn,'lp idl.ps' endif read,'Do you want to CONTINUE with THIS SECTION OF THE ATLAS (N/y)? ',ans if(ans eq 'y') then goto , CONT NEND: read,'Do you want to START OVER (N/y)? ',ans if(ans eq 'y') then goto,START end