pro make_figures,n,help=help,psf=psf,algorithm=algorithm if keyword_set(help) then begin print,'PURPOSE:' print,' Plot MEM and Clean maps with solar limb' print,'HELP:' print,' pro make_figures,n,/psf,/algorithm' print,' inputs: n (number of sources,integer)' print,' psf (default:no; /psf:activate Point Spread Function) print,' algorithm (default:MEM; otherwise algorithm=Clean/Pixon string)' print,' circles (default: no; /circles: draw circle regions)' print,' outputs: figure.ps(postscript)' print,' Don`t forget to rename the output!' print,'AUTHOR:' print,' Rick Pernak, Goddard Space Flight Center' return endif ;choose mapping algorithm and activate psf if keyword_set(algorithm) then algorithm = algorithm else algorithm='MEM' print,'Making ',algorithm,' figure' ;maps and flare info to be used in figures and legends restore,'/home/pernak/RHESSI/paper/figures/Clean/normal/idl_plots/clean_figs_legend.sav' restore,'/home/pernak/RHESSI/paper/figures/MEM/mem_figs_legend.sav' restore,'/home/pernak/RHESSI/paper/figures/Pixon/pixon_figs_legend.sav' ;used for positioning of plots (POSITION keyword in CONTOUR command) posx1 = 0 posx2 = .2 posy1 = .8 posy2 = 1 startx1 = posx1 startx2 = posx2 phi = findgen(360)*!dtor ;used for plotting solar limb lev = [.1,.2,.3,.4,.5,.6,.7,.8,.9,1.] if (algorithm eq 'MEM') then begin;outlines circle regions make_circle,n,dummy1,dummy2,circle1,circle2 endif else if (algorithm eq 'Clean') then begin a = 'clean' make_circle,n,dummy1,dummy2,circle1,circle2,al=a endif else if (algorithm eq 'Pixon') then begin a = 'pixon' make_circle,n,dummy1,dummy2,circle1,circle2,al=a endif title = algorithm+' Maps' ;title for figures for ctr=0,(n-1) do begin ;call program for determining solar radius in arcsec on a given day pbr = pb0r(date,/arcsec) r = pbr(2) if (algorithm ne 'Pixon') then begin xoff = data_mem(ctr).xyoff[0] ;MEM and Clean have same parameters (xyoff) yoff = data_mem(ctr).xyoff[1] xyint = data_mem(ctr).xyint ;only MEM structure has xyint (spatial scale) endif else begin xoff = data_pix(ctr).xyoff[0] yoff = data_pix(ctr).xyoff[1] xyint = data_mem(ctr).xyint endelse x = r*cos(phi) y = r*sin(phi) number=ctr+1 flare=string(number) ;flare number ;CHOOSE MEM OR CLEAN MAPS AND LEGEND INFO if (algorithm eq 'MEM') then begin map = mem[*,*,ctr] date = data_mem(ctr).date en = data_mem(ctr).energy uv = data_mem(ctr).circles endif else if (algorithm eq 'Clean') then begin map = clean[*,*,ctr] date = data_clean(ctr).date en = data_clean(ctr).energy uv = data_clean(ctr).detectors endif else if (algorithm eq 'Pixon') then begin map = pixon[*,*,ctr] date = data_pix(ctr).date en = data_pix(ctr).energy uv = data_pix(ctr).detectors endif else begin print,'Not a valid algorithm' return endelse xydim = size(map,/dimensions) xdim = xydim[0] ;size of array in the x direction (equals y dimension size) x = ((x-xoff)/xyint) + (xdim/2.) y = ((y-yoff)/xyint) + (xdim/2.) ;cartesian coordinates of limb, in pixels split = str_sep(uv,' ') ;separate string sc = double(split[2]) ;find lowest subcollimator if keyword_set(psf) then psf = hsi_pt_spread_fun(48,sc,2,/bessel) ;point spread function if keyword_set(psf) then map = convol(map,psf) ;convolve maps with Point Spread Function ;xranges and yranges have to be set to zoom in on map ;ranges differ according to the map: if (algorithm ne 'Pixon') then begin if (ctr eq 2) then begin xr = [22,86] yr = [37,101] endif else if (ctr eq 6) then begin xr = [32,96] yr = [42,106] endif else if (ctr eq 11) then begin xr = [52,116] yr = [32,96] endif else if (ctr eq 18) then begin xr = [27,91] yr = [32,96] endif else if (ctr eq 20) then begin xr = [2,66] yr = [32,96] endif else if (ctr eq 21) then begin yr = [22,86] xr = [32,96] endif else if (ctr eq 22) then begin xr = [12,76] yr = [42,106] endif else if (ctr eq 23) then begin xr = [42,106] yr = [52,116] endif else begin xr = [32,96] yr = [32,96] endelse endif else begin if (ctr eq 4) or (ctr eq 8) or (ctr eq 12) then begin xr = [-32,96] yr = [-32,96] endif else begin xr = [0,64] yr = [0,64] endelse endelse if (ctr eq 0) then begin set_plot,'ps' device,filename='figure.ps',xsize=16,ysize=16,yoffset=6,xoffset=3 contour,map,lev=lev*max(map),xtickformat='(A1)',ytickformat='(A1)',title=title,xr=xr,yr=yr,position=[posx1,posy1,posx2,posy2],/xst,/yst,/iso oplot,x,y,linestyle=5,thick=4 oplot,circle1[0,*,ctr],circle1[1,*,ctr],linestyle=2 oplot,circle2[0,*,ctr],circle2[1,*,ctr],linestyle=2 legend,[date,uv,en],box=0,charsize=.4,spacing=.4 legend,[flare],box=0,/right,/bottom,spacing=.4 endif else begin posx1 = posx1 + .2 posx2 = posx2 + .2 if (ctr mod 5) eq 0 then begin ;start on left and move to the right, go down every 5 plots posy1 = posy1 - .2 posy2 = posy2 - .2 posx1 = startx1 posx2 = startx2 contour,map,lev=lev*max(map),xtickformat='(A1)',ytickformat='(A1)',xr=xr,yr=yr,position=[posx1,posy1,posx2,posy2],/xst,/yst,/iso,/noerase oplot,x,y,linestyle=5,thick=4 oplot,circle1[0,*,ctr],circle1[1,*,ctr],linestyle=2 oplot,circle2[0,*,ctr],circle2[1,*,ctr],linestyle=2 legend,[date,uv,en],box=0,charsize=.4,spacing=.4 legend,[flare],box=0,/right,/bottom,spacing=.4 endif else begin contour,map,lev=lev*max(map),xtickformat='(A1)',ytickformat='(A1)',xr=xr,yr=yr,position=[posx1,posy1,posx2,posy2],/xst,/yst,/iso,/noerase oplot,x,y,linestyle=5,thick=4 oplot,circle1[0,*,ctr],circle1[1,*,ctr],linestyle=2 oplot,circle2[0,*,ctr],circle2[1,*,ctr],linestyle=2 legend,[date,uv,en],box=0,charsize=.4,spacing=.4 legend,[flare],box=0,/right,/bottom,spacing=.4 ; make darker circles around really small sources if (ctr eq 3) or (ctr eq 4) or (ctr eq 8) or (ctr eq 9) or (ctr eq 12) or (ctr eq 13) then begin contour,map,lev=lev*max(map),xtickformat='(A1)',ytickformat='(A1)',xr=xr,yr=yr,position=[posx1,posy1,posx2,posy2],/xst,/yst,/iso,/noerase oplot,x,y,linestyle=5,thick=4 oplot,circle1[0,*,ctr],circle1[1,*,ctr],linestyle=2,thick=4 oplot,circle2[0,*,ctr],circle2[1,*,ctr],linestyle=2,thick=4 legend,[date,uv,en],box=0,charsize=.4,spacing=.4 legend,[flare],box=0,/right,/bottom,spacing=.4 endif endelse if (ctr eq (n-1)) then begin device,/close set_plot,'x' endif endelse endfor return end