cleanplot if !d.name eq xdevice() then pfont=-1 else pfont=0 linecolors ;CREATE THE INCIDENT SOLAR FLARE PHOTON FLUXES ;------------------------------------------- ;Read in Fluence file file = loc_file( path=hessi_data_paths(), 'hessi_spec.dat',count=file_count) common hessi_spec, em, ftherm1, fbpow1, fnucl1, pi_not_en, pi_not_flux em = 0 ftherm1 =0 fbpow1 = 0 fnucl1 = 0 pi_not_en = 0 pi_not_flux =0 ftherm3 = 0 ;ftherm3 is flux from Te=4. MK and EM=1e49cm-3, it is flux, not fluence restore,/verbose,file(0) fcomp=ftherm1+fbpow1+fnucl1 fcomp_flux = fcomp/100. ;divide by the time to get flux from fluence fcomp_flux = fcomp_flux + interpol(pi_not_flux/100.,pi_not_en,em) ;------------------------------------------- ;------------------------------------------- ;Read in the HESSI background models for the Ge detectors read_hessi_dat, evec, backs, effarea ;------------------------------------------- ;------------------------------------------- ;GE EFFECTIVE AREAS hessi_grid_trans, etrans, trans atrans = interpol(total(trans,2)/12., etrans, em) ge_tot_area = 12*!pi*3.55^2 ge_scale = ge_tot_area * atrans ;------------------------------------------- ;------------------------------------------- ;GE WINDOW ATTENUATION read_seqfile,buff,loc_file(path=hessi_data_paths(),'hessi_windows.dat') ge_atten=fltarr(100,2) iline=(where(strpos(buff,'100 attenuation') ne -1))(0)+1 reads, buff(iline:*), ge_atten ge_atten=transpose(ge_atten) ge_fil = interpol( (ge_atten(1,*))(*), (ge_atten(0,*))(*), em) < max(ge_atten(1,*)) ;------------------------------------------- ;MAKE THE CUTOFFS BETWEEN THE SI, GE FRONT, AND GE BACK ENERGY RANGES ;lld cutoff wlld = where( em le 10.) w400 = where( em gt 400.) ;using array total peaks effective area (including escape and coincidence) ge_front = interpol( effarea(0).(0)/ge_tot_area, evec*1000., em) ge_total = interpol( effarea(8).(0)/ge_tot_area, evec*1000., em) ge_rear = ge_total-ge_front ge_rear(wlld) = 0.0 ge_total(wlld) = 0.0 ;Plot the front segment ge count rate ge_front(wlld) = 0.0 ge_front(w400) = 0.0 ;SI DETECTORS ;------------------------------------------- si_scale = 1/4.*12. si_eff = 1-exp(-.2*xsec(em<999.,14,'pe')) ;Extract the attenuation coefficients for the Si detectors iline=(where(strpos(buff,'Energies') ne -1))(0)+1 si_energ=fltarr(140) reads, buff(iline:*), si_energ iline=(where(strpos(buff,'Effective area cm2') ne -1))(0)+2 si_eff_fil =fltarr(140) reads, buff(iline:*), si_eff_fil si_fil_energ =si_eff_fil/( 1-exp(-.2*xsec(si_energ,14,'pe'))) ;take sharp edges out of filters here, filter should really be applied inside ;comp_spec_calc.pro, but for the purposes of the proposal figure we can do it here. em_smooth = findgen(200)*.25 +1. si_fil = smooth( interpol( si_fil_energ, si_energ, em_smooth),8) si_fil = interpol(si_fil, em_smooth, em) w50 = where(em ge 50.) si_eff(w50)=0.0 wlld_si = where( em lt 2.) si_eff(wlld_si) = 0.0 si_back= interpol(backs(0).back_rate/1000.* 12. /4.,evec*1000., em) ;Multiply si_back by an arbitrary factor of 10, we don't know this number at all! si_back = si_back*10. si_goes_clevel = smooth(si_eff*ftherm3/ge_scale * si_scale*si_fil,51) si_sum_back = si_goes_clevel+si_back si_sum_back([wlld_si,w50])=0 fcomp_flux = fcomp_flux * ge_tot_area label = bytarr(120) label(0)= byte('Total Incident Flux over Detector Area photons/detector area/s/keV') trace = {trace, energy_kev:em, flux:em*0.0, comment:bytarr(120)} traces = replicate( trace, 12) traces(0) = {trace, energy_kev:em, flux: fcomp_flux, comment:label} traces(1).flux = si_eff*fcomp_flux/ge_tot_area*si_scale*si_fil traces(1).comment = byte('Total Si Flare Count Rate counts/detector area/s/keV') traces(2).flux = si_sum_back traces(2).comment = byte('Total Si detectors background rate, counts/detector area/s/keV') traces(3).flux = ge_fil*ge_rear*fcomp_flux*atrans traces(3).comment = byte('Total Count Rate in Ge Rear Segments, counts/detector area/s/keV') traces(4).flux = ge_fil*ge_front*fcomp_flux*atrans traces(4).comment = byte('Total Count Rate in Ge Front Segments, counts/detector area/s/keV') traces(5).flux = interpol([backs(0).back_rate/1000.*ge_tot_area,2.5e-4,1e-4], $ [evec,50.,100.]*1000., em) traces(5).comment = byte('Total Background Count Rate in Ge Front Segments, counts/detector area/s/keV') traces(6).flux = interpol([(backs(1).back_rate-backs(0).back_rate)/1000.*ge_tot_area,5e-4,2e-4], $ [evec,50.,100.]*1000., em) traces(6).comment = byte('Total Background Count Rate in Ge Rear Segments, counts/detector area/s/keV') ;.762 is the fraction of the line within the full width ; 1-2*gaussint(-1*(2.36)/2) => 0.762 sensitivity = 3/(.762)* sqrt( $ (ge_fil*ge_rear*atrans*fcomp_flux+traces(6).flux)/ge_tot_area / $ (2. * ge_tot_area*100.) ) * ge_tot_area sensitivity(where( em lt 400.)) = 0. traces(7).flux = sensitivity traces(7).comment = byte('3 Sigma Sensitivity Level to Narrow Line (2 keV) Emission') checkvar,sfont,'' plot_oo,yrange=[1e-1,1e12],/ysty, font=pfont, $ traces(0).(0), traces(0).(1)*traces(0).(0)^2 ,charsi=1.5 , $ $;title=sfont+'Detected Solar Flare Spectrum', $ xtitle =sfont+'Energy (keV)', $ ytitle =sfont+ 'Photons or Counts (detector area s keV)!u-1!n x E!u2!n' colors = [255, 3,3, 7, 9, 7, 9, 255] linestyle = [0,0,2,0,0,2,2, 0] thick = [intarr(7),1.5] for i=1,7 do oplot, traces(i).(0), traces(i).(0)^2*traces(i).(1),color=colors(i),$ linestyle=linestyle(i), thick=thick(i) ;oplot, em, em^2 * si_eff*fcomp_flux/ge_tot_area * si_scale*si_fil, color=3 ;oplot, em, em^2 * si_sum_back, linestyle=2, color=3 ; Si background ;oplot, em, em^2 * ge_fil*ge_rear*fcomp_flux*atrans, color=7 ;oplot, em, em^2 * ge_fil*ge_total*fcomp_flux, color=7 ;oplot, em, em^2 * ge_fil*ge_front*fcomp_flux*atrans, color=9 ;oplot, evec*1000., (evec*1000.)^2 * $ ; backs(0).back_rate/1000.*ge_tot_area, linestyle=2, color=9 ;front segment background ;oplot, evec*1000., (evec*1000.)^2 * $ ; (backs(1).back_rate-backs(0).back_rate)/1000.*ge_tot_area, linestyle=2, color=7 ;rear background savefile = loc_file(path=hessi_data_paths(),count= count_savefile) if count_savefile eq 0 then save,file=savefile(0),traces,/xdr,/verb end