Skip to content
Snippets Groups Projects

Add acoustics monitoring

Merged Carlo Guidi requested to merge cguidi/km3mon:undefined into master
1 unresolved thread
Compare and Show latest version
1 file
+ 21
18
Compare changes
  • Side-by-side
  • Inline
+ 21
18
@@ -52,8 +52,11 @@ N_DUS = 5
DUS = range(1, N_DUS + 1)
#ACOUSTIC_BEACONS=[16] # Acoustic Beacons
#DOM=[7] #
#DU=[3] # DUs
#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,24 +67,24 @@ 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)
COL=[]
for i in DU:
DUx=[]
for j in ACOUSTIC_BEACONS:
for k in DOM:
for du in DUS:
N_Pulses_Indicator=[] # Array indicating for each DU how many pulses each piezo reveals.
for ab in ACOUSTIC_BEACONS:
for dom in DOMS:
try:
macaddress = db.doms.via_omkey((i,k), detid).dom_id
toas_all = sds.toashort(detid=detid, minrun=minrun, maxrun=maxrun, domid=macaddress, emitterid=j) # Prendere i dati basandosi sul tempo e non sul run????
macaddress = db.doms.via_omkey((du,dom), detid).dom_id
toas_all = sds.toashort(detid=detid, minrun=minrun, maxrun=maxrun, domid=macaddress, emitterid=ab)
QF_abdom=toas_all["QUALITYFACTOR"]
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)
@@ -155,20 +158,20 @@ while check==True:
print(NUM)
if (NUM>7):
DUx.append(1.5)
N_Pulses_Indicator.append(1.5)
elif (NUM<8 and NUM>3):
DUx.append(0.5)
N_Pulses_Indicator.append(0.5)
elif (NUM<4 and NUM>0):
DUx.append(-0.5)
N_Pulses_Indicator.append(-0.5)
elif (NUM==0):
DUx.append(-1.5)
N_Pulses_Indicator.append(-1.5)
except:
stop=[]
DUx.append(-1.5)
N_Pulses_Indicator.append(-1.5)
COL.append(DUx)
COL.append(N_Pulses_Indicator)
Loading