pro grismcal ;t stands for target data ;c stands for calibrator data ;f stands for calibrator fluxdensity tfile='' cfile='' ffile='' tline1=fltarr(1) tlinen=fltarr(1) cline1=fltarr(1) clinen=fltarr(1) fline1=fltarr(1) ;flinen=fltarr(1) trawspec=fltarr(320) crawspec=fltarr(320) trawspec=fltarr(320) frawspec=fltarr(320) finalspec=fltarr(2,320) tfile='f51g2c.fits' tline1=164 tlinen=175 cfile='aog1c.fits' cline1=180 clinen=191 ffile='aoric1.2.isoJy.fits' fline1=1 tdata=readfits(tfile,theader,exten_no=0) cdata=readfits(cfile,cheader,exten_no=0) fdata=readfits(ffile,fheader,exten_no=0) trawspec[*]=tdata[*,tline1-1] for i= tline1,tlinen-1 do begin trawspec[*]=trawspec[*] + tdata[*,i] endfor crawspec[*]=cdata[*,cline1-1] for i= cline1,clinen-1 do begin crawspec[*]=crawspec[*] + cdata[*,i] endfor frawspec[*]=fdata[*] for k=0,319 do begin finalspec[0,k]=7.773101+k*0.018661 finalspec[1,k]=(trawspec[k]/crawspec[k])*frawspec[k] if finalspec[1,k] lt 0 then finalspec[1,k]=0 endfor !p.multi=[0,2,2] plot, finalspec[0,*], trawspec[*] plot, finalspec[0,*], crawspec[*] plot, finalspec[0,*], frawspec[*] plot, finalspec[0,*], finalspec[1,*] set_plot,'ps' device, filename='spectra.ps' !p.multi=[0,2,2] plot, finalspec[0,*], trawspec[*], title='Raw IRAS 18151-1208', xtitle='Microns',$ ytitle='ADUS', xrange= [7.5,13.], yrange=[0,100] plot, finalspec[0,*], crawspec[*], title='Raw Alpha Ori', xtitle='Microns',$ ytitle='ADUS', xrange= [7.5,13.] plot, finalspec[0,*], frawspec[*],title='ISO Alpha Ori', xtitle='Microns',$ ytitle='Jy', xrange= [7.5,13.] plot, finalspec[0,*], finalspec[1,*],title='Calibrated IRAS 18151-1208', xtitle='Microns',$ ytitle='Jy', xrange= [7.5,13.] device, /close set_plot, 'x' ;openw,1,'testdump' ;for j=119,139 do begin ;print, trawspec[j]/12, crawspec[j]/12, frawspec[j] ;printf, 1, trawspec[j]/12, crawspec[j]/12, frawspec[j] ;endfor close, 1 end