Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified FinalTimepixDocumentation.pdf
Binary file not shown.
Binary file added FinalTimepixDocumentation_orig.pdf
Binary file not shown.
26 changes: 12 additions & 14 deletions dataAnalysis/hough1D.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
#!/usr/bin/python
import math
#!/usr/bin/python3

import sys
import numpy as np
from scipy import linspace, polyval, polyfit, sqrt, stats, randn
#from ROOT import gROOT, TCanvas,TH1D,TH2D,TFile,TStyle,TLegend,TPave,TPaveStats,TPad,TPaveLabel,gStyle,gPad,TPaletteAxis,TLine
#gROOT.Reset()
from ROOT import gROOT,TCanvas,TH1D,TH2D,TFile,TStyle,TLegend,TPave,TPaveStats,TPad,TPaveLabel,gStyle,TPaletteAxis,TLine
#gROOT.Reset()
from ROOT import TCanvas,TH1D,TFile,gStyle,TLine


def printCanvas(histogram,title):
Expand Down Expand Up @@ -37,13 +33,13 @@ def linearRegression(histogram):
if histogram.GetBinContent(i,k)!=0:
x.append(i)
y.append(k)
(ar,br)=polyfit(x,y,1)
xr=polyval([ar,br],x)
err=sqrt(sum((xr-y)**2)/len(y))
(ar,br)=np.polyfit(x,y,1)
xr=np.polyval([ar,br],x)
err=np.sqrt(sum((xr-y)**2)/len(y))
if abs(ar)>1.0:
(ar,br)=polyfit(y,x,1)
xr=polyval([ar,br],y)
err=sqrt(sum((xr-x)**2)/len(y))
(ar,br)=np.polyfit(y,x,1)
xr=np.polyval([ar,br],y)
err=np.sqrt(sum((xr-x)**2)/len(y))
return err


Expand Down Expand Up @@ -263,6 +259,8 @@ def hough(inputfile,pattern,folder,eventNumber):
del accumulator
meta.close()
return eventNumber
#if __name__ == '__main__':

if __name__ == '__main__':
# hough1D(inputfile,pattern,folder):
print("This file is to be imported as a module")

Binary file removed dataAnalysis/hough1D.pyc
Binary file not shown.
6 changes: 4 additions & 2 deletions dataAnalysis/loopClusters.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#!/usr/bin/env python3

from ROOT import gROOT, TCanvas, TH1D,TH2D,TFile
gROOT.Reset()
import numpy as np
import sys
print sys.argv
print (sys.argv)
import os
import os.path
import re
Expand All @@ -29,7 +31,7 @@ def plotClusters(filepath):
totalTime=0
numberOfPixels=0
fileS.write("new\n")
print "working with file ",filepath
print ("working with file ",filepath)
for line in open(filepath):
columns = line.split()
if columns[0]=="new":
Expand Down
4 changes: 3 additions & 1 deletion dataAnalysis/loopHough.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#!/usr/bin/env python3

from ROOT import gROOT, TCanvas, TH1D,TH2D,TFile
#gROOT.Reset()
import numpy as np
import sys
print sys.argv
print (sys.argv)
import os
import os.path
import re
Expand Down
2 changes: 2 additions & 0 deletions dataAnalysis/preprocess.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python3

from ROOT import gROOT, TCanvas, TH1D,TH2D,TFile
gROOT.Reset()
import numpy
Expand Down