function find_flares,mu_lo=mu_lo,mu_hi=mu_hi,peak_rate_min=peak_rate_min,plot=plot ; PURPOSE: To find flares above a certain peak rate AND with ; mu_lo * Rsun < mu_hi * Rsun ; mu = projected dist from sun center in units of solar radius (Rsun) ; Useful for finding near-center flares with higher albedo. ; ; METHOD: Uses the RHESSI online flarelist ; ; KEYWORDS: ; mu_lo = minimum dist from sun ctr (in units of 960") ; mu_hi = maximum dist from sun ctr (in units of 960") ; min_peak_rate = minimum allowed peak count rate in 12-25 keV band ; plot = switch to disable plot showing flare positions (default=1) ; OUTPUTS: Edited/downselected flarelist structure ; ; VERSION HISTORY: ; EJS March 2006 ; April 27 Fixed bug in r2 definition. ; RLP July 18, 2006 ; Deprecated mu keyword, added in mu_lo and mu_hi for upper and lower ; limits flares= hsi_read_flarelist() default,mu,0.5 default,peak_rate_min,5000. default,plot,1 w=where(flares.peak_countrate ge peak_rate_min,nw) if nw eq 0 then message, 'No flares found above this level.' flares1=flares[w] rr=(flares1.x_position^2+flares1.y_position^2) ww=where(rr eq 0, nw) message,'Found'+strcompress(nw)+' flares with no position.',/info ;;;;;;;;;; Take only flares with non-zero xyoffset (rr>0) ;;;;;;;;;;;; w1=where(rr gt 0) flares2=flares1(w1) ; These flares have a known position r2=sqrt(flares2.x_position^2+flares2.y_position^2) mu1=r2/960. ;;;;;;;;;;;Return flares with mu_lo <= mu1 <= mu_hi (nbhd of SC) w2=where(mu1 le mu_hi and mu1 ge mu_lo,nw) if nw eq 0 then message, 'No flares found with mu lt'+strcompress(mu) flares3=flares2(w2) r=sqrt(flares3.x_position^2+flares3.y_position^2) xt='X (arcsec)' & YT='Y (arcsec)' ti='FLARES WITH PEAK GT'+STRCOMPRESS(PEAK_RATE_MIN) if plot gt 0 then begin plot,/iso,flares3.x_position,flares3.Y_position,psym=6,TIT=TI,xtit=xt,ytit=yt,xra=[-1000,1000],yra=[-1000,1000] th=findgen(361)*!pi/180 x1=960*cos(th) & y1=960*sin(th) & y1=960*sin(th) oplot,x1,y1 oplot,mu_lo*x1,mu_lo*y1,line=2 ; oplot,mu_hi*x1,mu_lo*y1,line=2 endif nf=n_elements(flares3) message,'Found'+strcompress(nf)+' flares with mu_lo >='+strcompress(mu_lo)+$ ' and mu_hi <='+strcompress(mu_hi)+' rate >'+strcompress(peak_rate_min),/info return,flares3 end