import sendemail as se
	name = os.path.basename(__file__)
	se.send(name, message)
	
if cfg.plotcut:
	allcounts = cc.run(reconstructdata, rowcount, int(cfg.mincount))
	
	sys.path.append('/d6/rstein/Hamburg-Cosmic-Rays/BDT')
	import BDT
	BDT.run(reconstructdata, rowcount, int(cfg.mincount), allcounts)
	
	llcuts = oz.run(reconstructdata + "_BDT", rowcount, int(cfg.mincount), cfg.graph, allcounts)
	print llcuts
	pl.run(reconstructdata+ "_BDT", rowcount, int(cfg.mincount), cfg.graph, llcuts, allcounts)
	pz.run(reconstructdata+ "_BDT", rowcount, int(cfg.mincount), cfg.graph, llcuts, allcounts)
	pp.run(reconstructdata+ "_BDT", rowcount, int(cfg.mincount), cfg.graph, llcuts)
	pe.run(reconstructdata+ "_BDT", rowcount, int(cfg.mincount), cfg.graph, llcuts)
	ph.run(reconstructdata+ "_BDT", rowcount, int(cfg.mincount), cfg.graph, llcuts)
	
if cfg.plot:
	pz.run(reconstructdata, rowcount, int(cfg.mincount), cfg.graph, defaultcuts)
	pp.run(reconstructdata, rowcount, int(cfg.mincount), cfg.graph, defaultcuts)
	pe.run(reconstructdata, rowcount, int(cfg.mincount), cfg.graph, defaultcuts)
	ph.run(reconstructdata, rowcount, int(cfg.mincount), cfg.graph, defaultcuts)

#~ if cfg.plotangle:
	#~ pa.run(cfg.reconstructdata, rowcount, int(cfg.mincount), cfg.graph)

if cfg.radiusstatistics:
	rs.run(cfg.graph)
	
示例#2
0
if cfg.plotcut:
    allcounts = cc.run(reconstructdata, rowcount, int(cfg.mincount))

    sys.path.append('/d6/rstein/Hamburg-Cosmic-Rays/BDT')
    import BDT
    BDT.run(reconstructdata, rowcount, int(cfg.mincount), allcounts)

    llcuts = oz.run(reconstructdata + "_BDT", rowcount, int(cfg.mincount),
                    cfg.graph, allcounts)
    print llcuts
    pl.run(reconstructdata + "_BDT", rowcount, int(cfg.mincount), cfg.graph,
           llcuts, allcounts)
    pz.run(reconstructdata + "_BDT", rowcount, int(cfg.mincount), cfg.graph,
           llcuts, allcounts)
    pp.run(reconstructdata + "_BDT", rowcount, int(cfg.mincount), cfg.graph,
           llcuts)
    pe.run(reconstructdata + "_BDT", rowcount, int(cfg.mincount), cfg.graph,
           llcuts)
    ph.run(reconstructdata + "_BDT", rowcount, int(cfg.mincount), cfg.graph,
           llcuts)

if cfg.plot:
    pz.run(reconstructdata, rowcount, int(cfg.mincount), cfg.graph,
           defaultcuts)
    pp.run(reconstructdata, rowcount, int(cfg.mincount), cfg.graph,
           defaultcuts)
    pe.run(reconstructdata, rowcount, int(cfg.mincount), cfg.graph,
           defaultcuts)
    ph.run(reconstructdata, rowcount, int(cfg.mincount), cfg.graph,
           defaultcuts)
pl.run(reconstructdata + "_BDT",
       rowcount,
       int(mincount),
       graph=False,
       cuts=llcuts,
       allcounts=allcounts)
pz.run(reconstructdata + "_BDT",
       rowcount,
       int(mincount),
       graph=False,
       cuts=llcuts,
       allcounts=allcounts)
pp.run(reconstructdata + "_BDT",
       rowcount,
       int(mincount),
       graph=False,
       cuts=llcuts,
       allcounts=allcounts)
pe.run(reconstructdata + "_BDT",
       rowcount,
       int(mincount),
       graph=False,
       cuts=llcuts,
       allcounts=allcounts)
ph.run(reconstructdata + "_BDT",
       rowcount,
       int(mincount),
       graph=False,
       cuts=llcuts,
       allcounts=allcounts)
import categorycounts as cc

import initialise as i

orientation = "ideal"
mincount = 5

sys.path.append("/d6/rstein/Hamburg-Cosmic-Rays/BDT")
import BDT

with open(afspath + "/orientations/" + orientation + ".csv", "rb") as csvfile:
    reader = csv.reader(csvfile, delimiter=",", quotechar="|")
    rowcount = 0
    for row in reader:
        rowcount += 1

allcounts = cc.run(reconstructdata, rowcount, int(mincount))
print allcounts

BDT.run(reconstructdata, rowcount, int(mincount), allcounts)

llcuts = oz.run(reconstructdata + "_BDT", rowcount, int(mincount), graph=False, allcounts=allcounts)
print llcuts
pz.run(reconstructdata + "_BDT", rowcount, int(mincount), graph=False, cuts=None, allcounts=allcounts)

pl.run(reconstructdata + "_BDT", rowcount, int(mincount), graph=False, cuts=llcuts, allcounts=allcounts)
pz.run(reconstructdata + "_BDT", rowcount, int(mincount), graph=False, cuts=llcuts, allcounts=allcounts)
pp.run(reconstructdata + "_BDT", rowcount, int(mincount), graph=False, cuts=llcuts, allcounts=allcounts)
pe.run(reconstructdata + "_BDT", rowcount, int(mincount), graph=False, cuts=llcuts, allcounts=allcounts)
ph.run(reconstructdata + "_BDT", rowcount, int(mincount), graph=False, cuts=llcuts, allcounts=allcounts)
totaln = n*5000
print time.asctime(time.localtime()),"Cosmic Ray Iron Flux is", flux, "Simulated Area is", area, "Field of View is", solidangle, "Detected Flux is", detectedflux
print time.asctime(time.localtime()),"Rate per hour", rateperhour, "Simulated Hours", numberofhours, "Simulated Events", n 
print time.asctime(time.localtime()),"Simulated 500 events, equal to", totalhours, "Simulated Hours. Simulated Events", totaln 



pickle_dir = "/nfs/astrop/d6/rstein/chargereconstructionpickle/combined/"		
statsdata = pickle_dir + "stats.p"
traindata = pickle_dir + "trainingset.p"

plpd.run(statsdata)
BDT.run(traindata, statsdata, int(mincount))
pd.run(statsdata, int(mincount), cuts=[0.0, 0.0])
llcuts = oz.run(statsdata, int(mincount))
pem.run(statsdata, int(mincount), cuts=llcuts)
pb.run(statsdata, int(mincount), cuts=llcuts)
print "Log Likelihood Cuts", llcuts
pz.run(statsdata, int(mincount), cuts=None)
pe.run(statsdata, int(mincount), cuts=None)
pd.run(statsdata, int(mincount), cuts=None)
ph.run(statsdata, int(mincount), cuts=None)
pp.run(statsdata, int(mincount), cuts=None)

pz.run(statsdata, int(mincount), cuts=llcuts)
pl.run(statsdata, int(mincount), cuts=llcuts)
pp.run(statsdata, int(mincount), cuts=llcuts)
pd.run(statsdata, int(mincount), cuts=[0.0, 0.0])
pe.run(statsdata, int(mincount), cuts=llcuts)
ph.run(statsdata, int(mincount), cuts=llcuts)