pro plot_g230l_570_590,debug=debug ;IDL procedure for plotting the the G230L 19P/Borrelly spectra. ;Read the "normal" nucleus-centered spectrum (0.5 x 0.5 arcsec): read_file,'g230l_x2d_570-590.dat',w,f,e ;Rebin by a factor of 4. sf = rebin(f[0:1199],300) sw = rebin(w[0:1199],300) se = sqrt( rebin((e[0:1199])^2,300) ) / sqrt(4.) ;Read a solar spectrum that matches the resolution of the G230L spectra. ;Then scale it to match the continuum level of the cometary spectrum. ;Use "wshift" and "swshift" if you want CORR_SOLAR to estimate the wavelength ;shift; otherwise set the wavelength shift explicitly. ;delvar,wshift,swshift read_file,'/home/weaver/lee/hst/jun99/g230l_cysol.dat',xsol,ysol ;Interpolate the solar spectrum to the same wavelength scale as ;the cometary data. ;ysol = spline(xsol,ysol,w) ;Smooth the resolution of the solar spectrum if necessary. kwidth = 5 kernel = gaussian_kernel(kwidth,kwidth*3) cysol = convol(ysol,kernel) wshift=2.307 ;determined from the rebinned data swshift=2.307 ;might as well set this after running the first time corr_solar,xsol,ysol,w,f,sysol,wshift,lwave=2870.,hwave=3000. print,format='("wshift = ",f7.3," Angstroms")',wshift ;corr_solar,xsol,ysol,w,f,sysol,0.,lwave=2870.,hwave=3000. corr_solar,xsol,cysol,sw,sf,ssysol,swshift,lwave=2870.,hwave=3000. print,format='("swshift = ",f7.3," Angstroms")',swshift ;corr_solar,xsol,cysol,sw,sf,ssysol,0.,lwave=2870.,hwave=3000. ;Ratio the observed spectrum to the solar spectrum and then do ;a spline fit. ratio = f/sysol sratio = sf/ssysol ;Only run the next several lines the first time through. ;window,2,xs=800,ys=500 ;plot,sw,sratio,psym=10,xs=1,xr=[1800,3200],ys=1,yr=[0,4] ;hcursmark,x,y ;use this only the first time through ;file_xyz,ofile='xy_g230l_570-590.dat',x,y,/nonint ;After examining the data more carefully, I decided that the same continuum ;could be used for both visits 1 and 2. Since I like the continuum placement ;better for visit 2, I'll use that here also. ;read_file,'xy_g230l_570-590.dat',xcont,ycont read_file,'../visit2/xy_g230l_570-590.dat',xcont,ycont sxcont=xcont sycont=ycont redden_spline,w,sysol,xcont,ycont,cont,model redden_spline,sw,ssysol,sxcont,sycont,scont,smodel diff = f - cont sdiff = sf - scont if keyword_set(debug) then begin loadct_9colors,r,g,b window,2,xs=800,ys=500 plot,w,f,psym=10,xstyle=1,xrange=[2000,3200],ystyle=1,yrange=[-10,100],$ title='19P/Borrelly : 21 Sep 2001 (0.5" x 0.5", centered)' oplot,w,cont,psym=10,color=2 ymark,0 window,0,xs=800,ys=500 plot,w,ratio,psym=10,xs=1,xr=[1800,3200],ys=1,yr=[0,4] oplot,xcont,ycont,psym=7,symsize=2,color=3 oplot,w,model,color=2 window,1,xs=800,ys=500 plot,w,diff,psym=10,xs=1,xr=[2000,3200],ys=1,yr=[-10,50] ymark,0 window,6,xs=800,ys=500 plot,sw,sf,psym=10,xstyle=1,xrange=[2000,3200],ystyle=1,yrange=[-10,100],$ title='19P/Borrelly : 21 Sep 2001 (0.5" x 0.5", centered)' oplot,sw,scont,psym=10,color=2 ymark,0 window,4,xs=800,ys=500 plot,sw,sratio,psym=10,xs=1,xr=[1800,3200],ys=1,yr=[0,4] oplot,sxcont,sycont,psym=7,symsize=2,color=3 oplot,sw,smodel,color=2 window,5,xs=800,ys=500 plot,sw,sdiff,psym=10,xs=1,xr=[2000,3200],ys=1,yr=[-10,50] ymark,0 endif ;Write out the continuum and difference data with their errors. file_xyz,ofile='g230l_570-590_cont.dat',w,cont,e,/nonint file_xyz,ofile='g230l_570-590_diff.dat',w,diff,e,/nonint ;Calculate the brightnesses of the OH(0,0), OH(1,0), and CS(0,0) bands ;in the NET spectrum. integrate,sw,sdiff,oh00net,3050.,3110.,/nonint integrate_errors,sw,se,eoh00,3050.,3110.,/nonint integrate,sw,sdiff,oh10net,2795.,2850.,/nonint integrate_errors,sw,se,eoh10,2795.,2850.,/nonint integrate,sw,sdiff,cs00net,2545.,2600.,/nonint integrate_errors,sw,se,ecs00,2545.,2600.,/nonint journal,'g230l_570-590.txt' print,'For the NET spectrum....' print,'Integrating between 3050 A and 3110 A gives' print,format='("OH[0,0] = ",f8.1," +/- ",f8.2," Rayleighs")',oh00net,eoh00 print,'Integrating between 2795 A and 2850 A gives' print,format='("OH[1,0] = ",f8.1," +/- ",f8.2," Rayleighs")',oh10net,eoh10 print,'Integrating between 2545 A and 2600 A gives' print,format='("CS[0,0] = ",f8.1," +/- ",f8.2," Rayleighs")',cs00net,ecs00 journal ;stop ;Make some plots. ;!x.title='Wavelength (' + string("305B) + ')' ;!y.title='Brightness (Rayleighs ' + string("305B) + '!e-1!n)' !x.title='Wavelength (A)' !y.title='Brightness (Rayleighs A!e-1!n)' pssetup device,file='g230l_570-590.ps' loadct_9colors,/ps ;ploterr,w,f,e,psym=10,xstyle=1,xrange=[2000,3200],ystyle=1,yrange=[-100,5000],$ ;title='19P/Borrelly : 21 Sep 2001 (0.5" x 0.5", centered)',$ ;nskip=10,errcolor=3 plot,w,f,psym=10,xstyle=1,xrange=[2000,3200],ystyle=1,yrange=[-30,300],$ title='19P/Borrelly : 21 Sep 2001 (0.5" x 0.5", centered)' ;plot,sw,sf,psym=10,xstyle=1,xrange=[2000,3200],ystyle=1,yrange=[-30,300],$ ;title='19P/Borrelly : 21 Sep 2001 (0.5" x 0.5", centered)' ;Overplot a solar spectrum. oplot,w,cont,psym=10,color=2 ;oplot,sw,scont,psym=10,color=2 ymark,0 ;Put in some annotation. xyouts,3090,270,'OH (0,0)',align=0.5 xyouts,2826,100,'OH (1,0)',align=0.5 xyouts,2576,100,'CS (0,0)',align=0.5 plots,[3090,3090],[260,250] plots,[2826,2826],[90,60] plots,[2576,2576],[90,55] closeps xsetup pssetup device,file='g230l_570-590_expand.ps' loadct_9colors,/ps ;ploterr,w,f,e,psym=10,xstyle=1,xrange=[2000,3200],ystyle=1,yrange=[-10,50],$ ;title='19P/Borrelly : 21 Sep 2001 (0.5" x 0.5", centered)',$ ;nskip=10,errcolor=3 plot,w,f,psym=10,xstyle=1,xrange=[2000,3200],ystyle=1,yrange=[-10,100],$ title='19P/Borrelly : 21 Sep 2001 (0.5" x 0.5", centered)' ;plot,sw,sf,psym=10,xstyle=1,xrange=[2000,3200],ystyle=1,yrange=[-10,100],$ ;title='19P/Borrelly : 21 Sep 2001 (0.5" x 0.5", centered)' ;Overplot the continuum. oplot,w,cont,psym=10,color=2 ;oplot,sw,scont,psym=10,color=2 ymark,0 ;Put in some annotation. xyouts,2826,80,'OH (1,0)',align=0.5 xyouts,2576,60,'CS (0,0)',align=0.5 plots,[2826,2826],[75,60] plots,[2576,2576],[55,40] closeps xsetup pssetup device,file='g230l_570-590_emission.ps' loadct_9colors,/ps ;ploterr,w,diff,e,psym=10,xstyle=1,xrange=[2000,3200],ystyle=1,yrange=[-100,5000],$ ;title='19P/Borrelly : 21 Sep 2001 (0.5" x 0.5", centered)',$ ;nskip=10,errcolor=3 plot,w,diff,psym=10,xstyle=1,xrange=[2000,3200],ystyle=1,yrange=[-30,300],$ title='19P/Borrelly : 21 Sep 2001 (0.5" x 0.5", centered)' ymark,0 ;Put in some annotation. xyouts,3090,270,'OH (0,0)',align=0.5 xyouts,2826,100,'OH (1,0)',align=0.5 xyouts,2576,100,'CS (0,0)',align=0.5 plots,[3090,3090],[260,200] plots,[2826,2826],[90,50] plots,[2576,2576],[90,50] closeps xsetup pssetup device,file='g230l_570-590_emission_expand.ps' loadct_9colors,/ps ;ploterr,w,diff,e,psym=10,xstyle=1,xrange=[2000,3200],ystyle=1,yrange=[-100,500],$ ;title='19P/Borrelly : 21 Sep 2001 (0.5" x 0.5", centered)',$ ;nskip=10,errcolor=3 plot,w,diff,psym=10,xstyle=1,xrange=[2000,3200],ystyle=1,yrange=[-30,100],$ title='19P/Borrelly : 21 Sep 2001 (0.5" x 0.5", centered)' ymark,0 ;Put in some annotation. xyouts,2826,60,'OH (1,0)',align=0.5 xyouts,2576,60,'CS (0,0)',align=0.5 plots,[2826,2826],[55,40] plots,[2576,2576],[55,40] closeps xsetup !p.color=!d.n_colors-1 !x.title='' !y.title='' return end