From 2ef35228e9b440f86233a1a63908d78064679eb1 Mon Sep 17 00:00:00 2001
From: Jack Christopher Hutchinson Rolph <jack.rolph@desy.de>
Date: Thu, 12 May 2022 20:32:47 +0200
Subject: [PATCH] Update example.py

---
 example.py | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/example.py b/example.py
index 6dfc308..f763a9b 100644
--- a/example.py
+++ b/example.py
@@ -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')
@@ -40,6 +39,12 @@ for i, (file, path) in enumerate(files_to_fit):
     items = file.split('_')
 
     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. 
@@ -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)
-- 
GitLab