;restore,'curves_20141109_1522-1531.sav' flux=obs_data(4,*) bgr=flux(0:90) f=flux(90:134)-mean(bgr) nt=n_elements(f) df=(f-shift(f,1)) df(0)=0 time=indgen(nt-1) r=where(df ne 0,count) nt1=count df=df(r) time=time(r) sign_df=fix(df/abs(df)) d2f=shift(sign_df,-1)-sign_df d2f(nt1-1)=0 rp=where(d2f lt 0,count) np=count tp=(time(rp)+time(rp+1))/2 rm=where(d2f gt 0,count) nm=count tm=(time(rm)+time(rm+1))/2 if df(0) gt 0 then begin tm=[time(0)-1,tm] nm++ endif Pl=f(tp)-f(tm) bgr_m = mean(bgr) bgr_d = mean((bgr-bgr_m)^2) bgr_d1 = variance(bgr) f_m = mean(f) f_d = mean((f-f_m)^2) f_d1 = variance(f) tl = 3*sqrt(bgr_d) tl0 = 3*sqrt(bgr_d1) tl1 = 3*sqrt(bgr_d + f_d) tl11 = 3*sqrt(bgr_d1 + f_d1) photons=fltarr(np) for i=0,np-2 do $ ;photons(i)=total(f(tm(i):2*tp(i)-tm(i))) photons(i)=total(f(tm(i):tm(i+1))) photons(np-1)=total(f(tm(np-1):nt-1)) set_plot,'ps' device, ysize=29., xsize=20,xof=1,yof=0, filename='20141109_Peak_tabulation_50-100keV_test.ps', /color, bits_per_pix=8 !p.multi=[0,1,3] & !p.thick=2 & !p.charsize=2 & !p.charthick=2 & xmar=[2,2] & ymar=[2,2] plot,4*findgen(nt),f,xtitle=' ',ytitle='Count Rate (sec!u-1!n det!u-1!n)', $ yran = [0, 30], title='X-Ray Time Profile in 50-100 keV Band',xran=[-1,4*nt+1],/xst,/yst,$ position = [0.1, 0.7, 0.95, 0.99] for i=0,np-1 do $ oplot,[4*tp(i),4*tp(i)],[0,f(tp(i))],linest=2 for i=0,nm-1 do $ oplot,[4*tm(i),4*tm(i)],[0,f(tm(i))],linest=1 plot,[4*tp(0),4*tp(0)],[0,pl(0)],yran=[0,25],/yst,xran=[-1,4*nt+1],/xst,tit=' ',$ xtit=' ',ytitle='Count Rate (sec!u-1!n det!u-1!n)',thick=3,$ position = [0.1, 0.405, 0.95, 0.695] for i=1,np-1 do $ oplot,[4*tp(i),4*tp(i)],[0,pl(i)],thick=3 oplot,[0,4*nt],[tl,tl],linest=2 oplot,[0,4*nt],[tl0,tl0],linest=1 oplot,[0,4*nt],[tl1,tl1],linest=3, thick=3 oplot,[0,4*nt],[tl11,tl11],linest=1, thick=3 plot,[4*tp(0),4*tp(0)],[0,photons(0)],yran=[0,120],/yst,xran=[-1,4*nt+1],/xst,tit=' ',$ xtit='Time, sec',ytitle='Counts quantity per det', thick=3,$ position = [0.1, 0.1, 0.95, 0.40] for i=1,np-1 do $ oplot,[4*tp(i),4*tp(i)],[0,photons(i)],thick=3 !p.multi=0 device,/close set_plot,'win' end