Example #1
0
            print '[%d]' % i, entry
        idx = raw_input('which one should I use? ')
        idx = int(idx)
        _, to_use = matches[idx]

    print to_use.start.str, '-->', time.str
    points.append((to_use.start.time, time.time))


#linear fit
from rootpy import ROOT
ROOT.gROOT.SetBatch()
from rootpy.plotting import Graph, F1, Canvas

fcn = F1(args.fitfunc)
graph = Graph(len(points))
for idx, point in enumerate(points):
    x, y = point
    graph.SetPoint(idx, x, y)
graph.fit(fcn)

canvas = Canvas()
graph.Draw()
canvas.SaveAs("shifts.png")

with open(args.out, 'w') as out:
    for i, entry in enumerate(entries):
        entry.remap(fcn)
        out.write('%d\n' % i)
        out.write('%s\n\n' % entry.string)
Example #2
0
            _, entry = j
            print '[%d]' % i, entry
        idx = raw_input('which one should I use? ')
        idx = int(idx)
        _, to_use = matches[idx]

    print to_use.start.str, '-->', time.str
    points.append((to_use.start.time, time.time))

#linear fit
from rootpy import ROOT
ROOT.gROOT.SetBatch()
from rootpy.plotting import Graph, F1, Canvas

fcn = F1(args.fitfunc)
graph = Graph(len(points))
for idx, point in enumerate(points):
    x, y = point
    graph.SetPoint(idx, x, y)
graph.fit(fcn)

canvas = Canvas()
graph.Draw()
canvas.SaveAs("shifts.png")

with open(args.out, 'w') as out:
    for i, entry in enumerate(entries):
        entry.remap(fcn)
        out.write('%d\n' % i)
        out.write('%s\n\n' % entry.string)