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
No related branches found
No related tags found
No related merge requests found
......@@ -5,8 +5,7 @@ import numpy as np
import pandas as pd
from PeakOTron import PeakOTron
from joblib import dump
from time import time
import time
print("--------------------")
print('EXAMPLE SIPM CALIBRATION RUN')
......@@ -41,6 +40,12 @@ for i, (file, path) in enumerate(files_to_fit):
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.
data = np.loadtxt(path, skiprows=8)
......@@ -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.
time_end = time.time()
print("\n")
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):
for key in fit_out.keys():
out_dict[key].append(fit_out[key])
print("===============================================================")
print("\n\n")
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