Skip to content
Snippets Groups Projects
Commit 2ef35228 authored by Jack Christopher Hutchinson Rolph's avatar Jack Christopher Hutchinson Rolph
Browse files

Update example.py

parent 10913ef6
Branches
Tags
No related merge requests found
...@@ -5,8 +5,7 @@ import numpy as np ...@@ -5,8 +5,7 @@ import numpy as np
import pandas as pd import pandas as pd
from PeakOTron import PeakOTron from PeakOTron import PeakOTron
from joblib import dump from joblib import dump
from time import time import time
print("--------------------") print("--------------------")
print('EXAMPLE SIPM CALIBRATION RUN') print('EXAMPLE SIPM CALIBRATION RUN')
...@@ -41,6 +40,12 @@ for i, (file, path) in enumerate(files_to_fit): ...@@ -41,6 +40,12 @@ for i, (file, path) in enumerate(files_to_fit):
V = float(items[2].replace('V', '').replace('p', '.')) V = float(items[2].replace('V', '').replace('p', '.'))
print("\n\n")
print("===============================================================")
print("FIT {:d} - {:s}".format(i, file))
print("===============================================================")
print("\n\n")
## Load files. ## Load files.
data = np.loadtxt(path, skiprows=8) data = np.loadtxt(path, skiprows=8)
...@@ -59,10 +64,11 @@ for i, (file, path) in enumerate(files_to_fit): ...@@ -59,10 +64,11 @@ for i, (file, path) in enumerate(files_to_fit):
) #BINNING RULE "knuth", "freedman", "scott" - use bw= #### to override. it is still required for DCR calculation. ) #BINNING RULE "knuth", "freedman", "scott" - use bw= #### to override. it is still required for DCR calculation.
time_end = time.time() time_end = time.time()
print("\n")
print("Fit took {:3.3f} s".format(time_end - time_start)) print("Fit took {:3.3f} s".format(time_end - time_start))
print("\n")
f_data.PlotFit(xlabel="ADC", save_directory="./Results/{0}_fit.png".format(os.path.splitext(file)[0])) f_data.PlotFit(xlabel="ADC", display=False, save_directory="./Results/{0}_fit.png".format(os.path.splitext(file)[0]))
...@@ -90,6 +96,10 @@ for i, (file, path) in enumerate(files_to_fit): ...@@ -90,6 +96,10 @@ for i, (file, path) in enumerate(files_to_fit):
for key in fit_out.keys(): for key in fit_out.keys():
out_dict[key].append(fit_out[key]) out_dict[key].append(fit_out[key])
print("===============================================================")
print("\n\n")
df = pd.DataFrame.from_dict(out_dict) df = pd.DataFrame.from_dict(out_dict)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment