pro flux_plot,n,brightm,faintm,brightc,faintc,brightp,faintp,help=help,sum=sum,components=components if keyword_set(help) then begin print,'PURPOSE:' print,' Makes plottable MEM flux ratios vs. Clean flux ratios arrays print,' for brightest and faintest components' print,'HELP:' print,' pro flux_plot,n,brightm,faintm,brightc,faintc,brightp,faintp,/components' print,' inputs: n (number of sources,integer) print,' sum (default: no; /sum plot sums of components)' print,' components (default: no; /components plot individual components)' print,' outputs:brightm (bright MEM components, double array)' print,' faintm (faint MEM components, double array)' print,' brightc (bright Clean components, double array)' print,' faintc (faint Clean components, double array)' print,' brightp (bright Pixon components, double array)' print,' faintp (faint Pixon components, double array)' print,' PS Files: sum_plot.ps and/or bright_weak_flux.ps' print,'AUTHOR:' print,' Rick Pernak, Goddard Space Flight Center' return endif temp_mem = '/home/pernak/RHESSI/paper/spreadsheet/mem.csv' temp_clean = '/home/pernak/RHESSI/paper/spreadsheet/clean.csv' temp_pixon = '/home/pernak/RHESSI/paper/spreadsheet/pixon.csv' openr,1,temp_mem mem=strarr(n) readf,1,mem close,1 openr,1,temp_clean clean=strarr(n) readf,1,clean close,1 openr,1,temp_pixon pixon=strarr(n) readf,1,pixon close,1 ;'catch' all the mem fluxes for ctr=0,(n-1) do begin split = str_sep(mem(ctr),9B) source1 = double(split[1]) source2 = double(split[2]) if (ctr eq 0) then begin brightm = [source1] faintm = [source2] endif else begin brightm = [brightm,source1] faintm = [faintm,source2] ;brightest and faintest mem sources endelse endfor ;'catch' brightest and faintest clean fluxes for ctr=0,(n-1) do begin split = str_sep(clean(ctr),9B) source1 = double(split[1]) source2 = double(split[2]) if (ctr eq 0) then begin brightc = [source1] faintc = [source2] endif else begin brightc = [brightc,source1] faintc = [faintc,source2] endelse endfor ;catch pixon source fluxes for ctr=0,(n-1) do begin split = str_sep(pixon(ctr),9B) source1 = double(split[1]) source2 = double(split[2]) if (ctr eq 0) then begin brightp = [source1] faintp = [source2] endif else begin brightp = [brightp,source1] faintp = [faintp,source2] endelse endfor ;produce MEM, Clean, and Pixon Sum plots if keyword_set(sum) then begin set_plot,'ps' device,filename='sum_plot.ps' ; MEM vs. Clean plot,brightm+faintm,brightc+faintc,/iso,/xlog,/ylog, $ title='MEM and Clean Flux Sums',xtitle='MEM (bright+weak,log)', $ ytitle='Clean (bright+weak,log)',psym=5 oplot,[1,1000],[1,1000],psym=-3 for ctr=0,(n-1) do begin xyouts,brightm(ctr)+faintm(ctr),brightc(ctr)+faintc(ctr),strcompress(ctr+1,/rem),charsize=1.5 endfor ; MEM vs. Pixon plot,brightm+faintm,brightp+faintp,/iso,/xlog,/ylog, $ title='MEM and Pixon Flux Sums',xtitle='MEM (bright+weak,log)', $ ytitle='Pixon (bright+weak,log)',psym=5 oplot,[1,1000],[1,1000],psym=-3 for ctr=0,(n-1) do begin xyouts,brightm(ctr)+faintm(ctr),brightp(ctr)+faintp(ctr),strcompress(ctr+1,/rem),charsize=1.5 endfor ; Pixon vs. Clean plot,brightp+faintp,brightc+faintc,/iso,/xlog,/ylog, $ title='Pixon and Clean Flux Sums',xtitle='Pixon (bright+weak,log)', $ ytitle='Clean (bright+weak,log)',psym=5 oplot,[1,1000],[1,1000],psym=-3 for ctr=0,(n-1) do begin xyouts,brightp(ctr)+faintp(ctr),brightc(ctr)+faintc(ctr),strcompress(ctr+1,/rem),charsize=1.5 endfor device,/close set_plot,'x' endif units = ' (photons cm!E-2!N s!E-1!N)' ;produce component plots if keyword_set(components) then begin set_plot,'ps' device,filename='bright_weak_flux_mc.ps' ; MEM vs. Clean plot,brightm,brightc,/iso,/xlog,/ylog,psym=5, $ xtitle='MEM Fluxes'+units, ytitle='Clean Fluxes'+units,charsize=1.5 for ctr=0,(n-1) do begin xyouts,brightm(ctr),brightc(ctr),strcompress(ctr+1,/rem),charsize=1.5 endfor oplot,faintm,faintc,psym=1 for ctr=0,(n-1) do begin xyouts,faintm(ctr),faintc(ctr),strcompress(ctr+1,/rem),charsize=1.5 endfor ;y=x line and legend oplot,[1,1000],[1,1000],psym=-3 legend,['Brighter Component','Fainter Component'],psym=[5,1],box=0,charsize=1.5 device,/close device,filename='bright_weak_flux_mp.ps' ; MEM vs. Pixon plot,brightm,brightp,/iso,/xlog,/ylog,psym=5, $ xtitle='MEM Fluxes'+units, ytitle='Pixon Fluxes'+units,charsize=1.5 for ctr=0,(n-1) do begin xyouts,brightm(ctr),brightp(ctr),strcompress(ctr+1,/rem),charsize=1.5 endfor oplot,faintm,faintp,psym=1 for ctr=0,(n-1) do begin xyouts,faintm(ctr),faintp(ctr),strcompress(ctr+1,/rem),charsize=1.5 endfor ;y=x line and legend oplot,[1,1000],[1,1000],psym=-3 legend,['Brighter Component','Fainter Component'],psym=[5,1],box=0,charsize=1.5 device,/close device,filename='bright_weak_flux_pc.ps' ; Pixon vs. Clean plot,brightp,brightc,/iso,/xlog,/ylog,psym=5, $ xtitle='Pixon Fluxes'+units, ytitle='Clean Fluxes'+units,charsize=1.5 for ctr=0,(n-1) do begin xyouts,brightp(ctr),brightc(ctr),strcompress(ctr+1,/rem),charsize=1.5 endfor oplot,faintp,faintc,psym=1 for ctr=0,(n-1) do begin xyouts,faintp(ctr),faintc(ctr),strcompress(ctr+1,/rem),charsize=1.5 endfor ;y=x line and legend oplot,[1,1000],[1,1000],psym=-3 legend,['Brighter Component','Fainter Component'],psym=[5,1],box=0,charsize=1.5 device,/close set_plot,'x' endif return end