f2 = open('TLresult30MeV.dat', 'w') for line in range(len(TList)): f.writelines('%s %s' % (TList[line], LconList[line]) + str('\n')) f2.writelines('%s %s' % (TList[line], LconList2[line]) + str('\n')) pass f.close f2.close g0 = mydef.make_graph(xList=TList, yList=np.log10(LconList), name='GRB', title='GRB', xtitle='T[MeV]', ytitle='L [erg]', iColor=2, iSize=2, iStyle=1, errPlot=False, errxList=None, erryList=None, xmin=None, xmax=None, ymin=None, ymax=None) g1 = mydef.make_graph(xList=TList, yList=np.log10(LconList2), name='GRB', title='GRB', xtitle='T[MeV]', ytitle='L [erg]', iColor=3,
import numpy as np import mydef,ROOT,RootLogon ## Read our result #[TList,LListS]=np.loadtxt('../coincidence_analysis_short/TLresult2.dat',unpack=True) #[TList,LListL]=np.loadtxt('../coincidence_analysis_short/TLresult.dat',unpack=True) [TList,LListL]=np.loadtxt('../coincidence_analysis/TLresult2.dat',unpack=True) [TList,LListS]=np.loadtxt('../coincidence_analysis_short/TLresult2.dat',unpack=True) g1=mydef.make_graph( xList=TList, yList=LListL, name='GRB', title='GRB', xtitle='Temperature[MeV]', ytitle='Luminosity [erg]', iColor=2, iSize=2, iStyle=1, errPlot=False,errxList=None, erryList=None, xmin=0, xmax=15, ymin=1e+51, ymax=1e+61) g2=mydef.make_graph( xList=TList, yList=LListS, name='GRB', title='GRB', xtitle='Enu[MeV]', ytitle='Fluence [cm-2]', iColor=4, iSize=2, iStyle=1, errPlot=False,errxList=None, erryList=None, xmin=0, xmax=15, ymin=6, ymax=16) ## Theoritical prediction # Phys.Rev.D 80, 123004 (2009) and PTP 108, 789 (2002) x1 = np.array([5., 7.4]) y1 = np.array([1e+52,3.6e+52]) # Phys.Rev.Lett 107, 051102 (2011) x3 = np.array([6.3,9.5]) y3 = np.array([3e+53,3e+53])
a = (EffList[line2] - EffList[line2-1])/(EvList[line2]-EvList[line2-1]) b = EffList[line2-1] - a * EvList[line2-1] NewEffList.append(a * EpList[line] + b) pass pass if EpList[line] > EvList[-1]: NewEffList.append(EffList[-2]) pass pass NewEffList = np.array(NewEffList) g1=mydef.make_graph( xList=EvList, yList=EffList, name='Neutrino energy', title='Presupernova neutrino (nu_e)', xtitle='Energy [MeV]', ytitle='Flux', iColor=2, iSize=2, iStyle=2, errPlot=False,errxList=None, erryList=None, xmin=None, xmax=None, ymin=None, ymax=None) g2=mydef.make_graph( xList=EpList, yList=NewEffList, name='Neutrino energy', title='Presupernova neutrino (nu_x)', xtitle='Energy [MeV]', ytitle='Flux', iColor=4, iSize=2, iStyle=2, errPlot=False,errxList=None, erryList=None, xmin=None, xmax=None, ymin=None, ymax=None) c0 = ROOT.TCanvas('plot', 'plot', 600, 600) c0.Divide(1,1) c0.Draw() c0.cd(1) g1.Draw('ALP')
lGRB_z = lGRB_data[:, 3] [x, yl] = mydef.make_histdata(lGRB_t, xmin, xmax, N) sGRB_data = np.loadtxt('../coincidence_analysis_short/coincidence_time.dat') sGRB_t = sGRB_data[:, 0] - toffset0 sGRB_z = sGRB_data[:, 3] [x, ys] = mydef.make_histdata(sGRB_t, xmin, xmax, N) g1 = mydef.make_graph(xList=x, yList=yl, name='hoge', title='GRB list', xtitle='Date', ytitle='Num of GRB/month', iColor=2, iSize=1, iStyle=3, errPlot=True, errxList=dt / 2. * np.ones(len(x)), erryList=np.zeros(len(x)), xmin=xmin - 60 * 60 * 24 * 63, xmax=xmax, ymin=None, ymax=None) g2 = mydef.make_graph(xList=x, yList=ys, name='hoge', title='GRB list', xtitle='Date', ytitle='Redshift', iColor=4,
for line in range(len(EList1)): f.writelines( '%s %s %s %s' % (EList1[line], NList5[line], NList10[line], NList15[line]) + str('\n')) pass f.close g0 = mydef.make_graph(xList=EList1, yList=NList5, name='GRB', title='GRB', xtitle='T[MeV]', ytitle='L [erg]', iColor=2, iSize=2, iStyle=1, errPlot=False, errxList=None, erryList=None, xmin=None, xmax=None, ymin=None, ymax=None) g1 = mydef.make_graph(xList=EList1, yList=NList10, name='GRB', title='GRB', xtitle='T[MeV]', ytitle='L [erg]', iColor=3,
xbinmax = 12000 h_run = mydef.make_hist(runList, 'runList (7.5-150MeV)', Nbins, xbinmin, xbinmax, 2, 2, False) h_run1 = mydef.make_hist(runList1, 'runList (7.5-30MeV)', Nbins, xbinmin, xbinmax, 4, 2, False) h_run2 = mydef.make_hist(runList2, 'runList (80-150MeV)', Nbins, xbinmin, xbinmax, 4, 2, False) g0 = mydef.make_graph(xList=rpx**2 + rpy**2, yList=rpz, name='hoge', title='Vertex prompt (7.5--150MeV)', xtitle='rx^2 + ry^2', ytitle='rz', iColor=2, iSize=1.2, iStyle=2, errPlot=False, errxList=None, erryList=None, xmin=0, xmax=50, ymin=-7, ymax=+7) g1 = mydef.make_graph(xList=rdx**2 + rdy**2, yList=rdz, name='hoge', title='Vertex delayed (7.5--150MeV)', xtitle='rx^2 + ry^2', ytitle='rz', iColor=4,
YList1 = np.array(YList1) Nbins = 20 xbinmin = 0 xbinmax = 10 h0 = mydef.make_hist(zList0, 'hoge1', Nbins, xbinmin, xbinmax, 2, 1, False) h1 = mydef.make_hist(zList1, 'hoge2', Nbins, xbinmin, xbinmax, 4, 1, False) g0 = mydef.make_graph(xList=xList, yList=YList0, name='hoge', title='cumulative sum', xtitle='Redshift', ytitle='Number', iColor=2, iSize=3, iStyle=1, errPlot=False, errxList=None, erryList=None, xmin=0, xmax=10, ymin=None, ymax=None) g1 = mydef.make_graph(xList=xList, yList=YList1, name='hoge', title='cumulative sum', xtitle='Redshift', ytitle='Number', iColor=4,
pass xList = np.array(xList) yList1 = np.array(yList1) yList2 = np.array(yList2) yList3 = np.array(yList3) for line in range(Nbins): YList1.append(np.sum(yList1[:line])) YList2.append(np.sum(yList2[:line])) YList3.append(np.sum(yList3[:line])) pass YList1 = np.array(YList1) YList2 = np.array(YList2) YList3 = np.array(YList3) g1=mydef.make_graph( xList=xList, yList=YList1+YList2, name='hoge', title='cumulative sum', xtitle='date', ytitle='Number', iColor=1, iSize=3, iStyle=1, errPlot=False,errxList=None, erryList=None, xmin=xbinmin, xmax=xbinmax, ymin=None, ymax=None) g2=mydef.make_graph( xList=xList, yList=YList1+YList2+YList3, name='hoge', title='cumulative sum', xtitle='date', ytitle='Number', iColor=2, iSize=3, iStyle=1, errPlot=False,errxList=None, erryList=None, xmin=xbinmin, xmax=xbinmax, ymin=None, ymax=None) g3=mydef.make_graph( xList=xList, yList=YList2, name='hoge', title='cumulative sum', xtitle='date', ytitle='Number', iColor=4, iSize=3, iStyle=1, errPlot=False,errxList=None, erryList=None, xmin=xbinmin, xmax=xbinmax, ymin=0, ymax=250) c0 = ROOT.TCanvas('plot1', 'plot1', 1200, 900)
## Read our result [EList, FListL] = np.loadtxt('../coincidence_analysis/fluence_long.dat', unpack=True) [EList, FListS] = np.loadtxt('../coincidence_analysis_short/fluence_short.dat', unpack=True) g1 = mydef.make_graph(xList=EList, yList=FListL, name='GRB', title='GRB', xtitle='Enu[MeV]', ytitle='Fluence [cm-2]', iColor=2, iSize=2, iStyle=1, errPlot=False, errxList=None, erryList=None, xmin=0, xmax=13, ymin=1e+6, ymax=1e+12) g2 = mydef.make_graph(xList=EList, yList=FListS, name='GRB', title='GRB', xtitle='Enu[MeV]', ytitle='Fluence [cm-2]', iColor=4,
EvList10 = (Ngrb1*e1 +Ngrb3 *e3)/(Ngrb1 + Ngrb3)**2 * EvList10 EvList15 = (Ngrb1*e1 +Ngrb3 *e3)/(Ngrb1 + Ngrb3)**2 * EvList15 EvList5 = tEff*Nt*CList*F5 EvList10 = tEff*Nt*CList*F10 EvList15 = tEff*Nt*CList*F15 EvList5_ = (Ngrb1*e1 +Ngrb3 *e3)/(Ngrb1 + Ngrb3)**2 * EvList5 EvList10_ = (Ngrb1*e1 +Ngrb3 *e3)/(Ngrb1 + Ngrb3)**2 * EvList10 EvList15_ = (Ngrb1*e1 +Ngrb3 *e3)/(Ngrb1 + Ngrb3)**2 * EvList15 print "Event : %s" %np.sum(EvList5) f1=mydef.make_graph( xList=EnuList, yList=F5*5/dE, name='GRB', title='Period I', xtitle='Enu [MeV]', ytitle='Flux/5MeV', iColor=4, iSize=2, iStyle=1, errPlot=False,errxList=None, erryList=None, xmin=0, xmax=100, ymin=None, ymax=None) f2=mydef.make_graph( xList=EnuList, yList=F10*5/dE, name='GRB', title='Period I', xtitle='Enu [MeV]', ytitle='/5MeV', iColor=4, iSize=2, iStyle=1, errPlot=False,errxList=None, erryList=None, xmin=0, xmax=100, ymin=None, ymax=None) f3=mydef.make_graph( xList=EnuList, yList=F15*5/dE, name='GRB', title='Period I', xtitle='Enu [MeV]', ytitle='/5MeV', iColor=4, iSize=2, iStyle=1, errPlot=False,errxList=None, erryList=None, xmin=0, xmax=100, ymin=None, ymax=None) g1=mydef.make_graph( xList=EpList, yList=EvList5*5/dE, name='GRB', title='Period I', xtitle='Ep [MeV]', ytitle='Events/5MeV', iColor=4, iSize=2, iStyle=1, errPlot=False,errxList=None, erryList=None, xmin=0, xmax=100, ymin=None, ymax=None) g2=mydef.make_graph( xList=EpList, yList=EvList10*5/dE, name='GRB',
f = open('fluence_long.dat', 'w') for line in range(len(EList2)): f.writelines('%s %s' % (EList2[line], FList2[line]) + str('\n')) pass f.close g1 = mydef.make_graph(xList=EList2, yList=np.log10(FList2), name='GRB', title='GRB', xtitle='Enu[MeV]', ytitle='Fluence [cm-2]', iColor=2, iSize=2, iStyle=1, errPlot=False, errxList=None, erryList=None, xmin=0, xmax=13, ymin=6, ymax=16) ROOT.gROOT.SetStyle('Plain') #ROOT.gROOT.SetBatch(False) c0 = ROOT.TCanvas('plot0', 'plot0', 600, 600) c0.Divide(1, 1) c0.Draw() c0.cd(1)