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
+ 19
20
Compare changes
  • Side-by-side
  • Inline
+ 19
20
@@ -24,11 +24,11 @@ from datetime import datetime
import km3pipe as kp
parser = argparse.ArgumentParser(description='Online_monitoring')
parser.add_argument('-d', dest='det_id', type=str, nargs=1, required=True,
help='The detector ID (e.g. D_ORCA005)')
parser.add_argument('-o', dest='plot_dir', type=str, nargs=1, required=True,
help='Directory in which the plot is saved')
parser = argparse.ArgumentParser(description = 'Online_monitoring')
parser.add_argument('-d', dest = 'det_id', type = str, nargs = 1, required = True,
help = 'The detector ID (e.g. D_ORCA005)')
parser.add_argument('-o', dest = 'plot_dir', type = str, nargs = 1, required = True,
help = 'Directory in which the plot is saved')
args = parser.parse_args()
detid = args.det_id[0]
@@ -40,7 +40,7 @@ def diff(first, second):
db = kp.db.DBManager()
sds = kp.db.StreamDS()
table=db.run_table(detid)
table = db.run_table(detid)
@@ -73,7 +73,7 @@ while check:
for dom in DOMS:
try:
domID = db.doms.via_omkey((du, dom), detid).dom_id
toas_all = sds.toashort(detid=detid, minrun=minrun, maxrun=maxrun, domid=domID, emitterid=ab)
toas_all = sds.toashort(detid = detid, minrun = minrun, maxrun = maxrun, domid = domID, emitterid = ab)
QF_abdom = toas_all["QUALITYFACTOR"]
UTB_abdom = toas_all["UNIXTIMEBASE"]
@@ -124,7 +124,7 @@ while check:
if len(QF_second) > 11:
QF_second = np.array(QF_second)
QF_third = [k for k in QF_second if (np.where(QF_second == k)[0][0]<11)]
QF_third = [k for k in QF_second if (np.where(QF_second == k)[0][0] < 11)]
else:
QF_third = QF_second
@@ -139,11 +139,11 @@ while check:
Q.append(np.where(SIGNAL_OLD == QF_fourth[q])[0][0])
UTB_fourth = np.array(UTB_SIGNAL.tolist())[Q]
UTB_fourth_l = UTB_fourth.tolist()
D=[]
D = []
for g in np.arange(len(UTB_fourth_l)):
if ((np.mod((UTB_fourth_l[g] - UTB_fourth_l[0]), 5) > 0.5 and np.mod((UTB_fourth_l[g] - UTB_fourth_l[0]), 5) < 4.5) or (np.mod((UTB_fourth_l[g] - UTB_fourth_l[0]), 5)>5)):
D.append(g)
for d in sorted(D, reverse=True):
for d in sorted(D, reverse = True):
del QF_fourth[d]
QF_fifth = QF_fourth
QF_OK = QF_fifth
@@ -229,17 +229,17 @@ while check:
cbar = plt.colorbar(color)
cbar.ax.get_yaxis().set_ticks([])
for j, lab in enumerate(['$0. pings$', '$1-3 pings$', '$4-7 pings$', '$>7. pings$']):
cbar.ax.text(3.5, (2 * j + 1)/8.0, lab, ha='center', va='center')
cbar.ax.text(3.5, (2 * j + 1)/8.0, lab, ha = 'center', va = 'center')
cbar.ax.get_yaxis().labelpad = 18
matplotlib.pyplot.xticks(np.arange(1, 6, step=1))
matplotlib.pyplot.yticks(np.arange(0, 19, step=1))
matplotlib.pyplot.grid(color='k', linestyle='-', linewidth=0.2)
ax.set_xlabel('DUs', fontsize=18)
ax.set_ylabel('Floors', fontsize=18)
ts = now+3600
matplotlib.pyplot.xticks(np.arange(1, 6, step = 1))
matplotlib.pyplot.yticks(np.arange(0, 19, step = 1))
matplotlib.pyplot.grid(color = 'k', linestyle = '-', linewidth = 0.2)
ax.set_xlabel('DUs', fontsize = 18)
ax.set_ylabel('Floors', fontsize = 18)
ts = now + 3600
DATE = datetime.utcfromtimestamp(ts).strftime('%Y-%m-%d %H:%M:%S')
ax.set_title(r' %.16s Detection of the pings emitted by autonomous beacons' %DATE, fontsize=10)
ax.set_title(r' %.16s Detection of the pings emitted by autonomous beacons' %DATE, fontsize = 10)
# plt.show()
@@ -258,5 +258,4 @@ while check:
time.sleep(abs(TIT - check_time))
check = True
check = True
Loading