From 29d49e621b5f59d10d5f1799c70ffb7fd6afc041 Mon Sep 17 00:00:00 2001
From: Carlo Guidi <cguidi@km3net.de>
Date: Mon, 13 Jan 2020 14:20:27 +0100
Subject: [PATCH] Update acoustics.py

---
 scripts/acoustics.py | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/scripts/acoustics.py b/scripts/acoustics.py
index f9807de..b0e1010 100644
--- a/scripts/acoustics.py
+++ b/scripts/acoustics.py
@@ -55,6 +55,9 @@ DUS = range(1, N_DUS + 1)
 #DOMS=[7] # DOMs
 #DUS=[3] # DUs
 
+TIT=600 # Time Interval between Trains of acoustic pulses)
+SSW=160 # Signal Security Window (Window size with signal)
+
 check=True
 while check==True:
     
@@ -64,7 +67,7 @@ while check==True:
     mintime=mintime1.values
     maxrun=table["RUN"][len(table["RUN"])-1]
     now=time.time()
-    if (now-mintime/1000)<600:
+    if (now-mintime/1000)<TIT:
         minrun=table["RUN"][len(table["RUN"])-1]-1 
     print(now)
 
@@ -81,7 +84,7 @@ while check==True:
                     UTB_abdom=toas_all["UNIXTIMEBASE"]
                     TOAS_abdom=toas_all["TOA_S"]
                     UTB_abdom=UTB_abdom.values
-                    up=np.where(UTB_abdom>(now-600))
+                    up=np.where(UTB_abdom>(now-TIT))
                     down=np.where(UTB_abdom<(now))
                     intr=np.intersect1d(up,down)
                     UTB_abdom=UTB_abdom[intr]
@@ -91,8 +94,8 @@ while check==True:
                     QFlist.sort(reverse=True)
                     QF_max=max(QF_abdom)
                     QF_max_index=np.where(QF_abdom==QF_max)
-                    UTB_signal_min=UTB_abdom[QF_max_index]-80
-                    UTB_signal_max=UTB_abdom[QF_max_index]+80
+                    UTB_signal_min=UTB_abdom[QF_max_index]-SSW/2
+                    UTB_signal_max=UTB_abdom[QF_max_index]+SSW/2
                     temp1=np.where(UTB_abdom>(UTB_signal_min[0]))
                     temp2=np.where(UTB_abdom<(UTB_signal_max[0]))
                     inter=np.intersect1d(temp1,temp2)
-- 
GitLab