Skip to content
Snippets Groups Projects

Add acoustics monitoring

Merged Carlo Guidi requested to merge cguidi/km3mon:undefined into master
Compare and Show latest version
1 file
+ 11
19
Compare changes
  • Side-by-side
  • Inline
+ 11
19
@@ -9,20 +9,19 @@ Usage:
Options:
-d DET_ID Detector ID
-ndu N_DUS Number of DUs
-n N_DUS Number of DUs
-o PLOT_DIR The directory to save the plot
-h --help Show this screen.
"""
import numpy as np
import matplotlib.pyplot as plt
import argparse
import time
import os
import matplotlib
from matplotlib import colors
from datetime import datetime
from docopt import docopt
import km3pipe as kp
@@ -31,19 +30,12 @@ def diff(first, second):
return [item for item in first if item not in second]
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('-ndu', dest = 'n_dus', type = int, nargs = 1, required = True,
help = 'Number of DUs (e.g. 5)')
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]
directory = args.plot_dir[0]
N_DUS = args.n_dus[0]
args = docopt(__doc__)
detid = args['-d']
directory = args['-o']
N_DUS = args['-n']
N_DUS = int(N_DUS)
db = kp.db.DBManager()
sds = kp.db.StreamDS()
@@ -197,9 +189,9 @@ while check:
iAB2 = np.intersect1d(iAB2_up, iAB2_down)
iAB3 = np.where(ind[0] > (2*L - 1))
colorsList = [(0, 0, 0),(1, 0.3, 0),(1, 1, 0),(0.2, 0.9, 0)]
colorsList = [(0, 0, 0), (1, 0.3, 0), (1, 1, 0), (0.2, 0.9, 0)]
CustomCmap = matplotlib.colors.ListedColormap(colorsList)
bounds=[-2, -1, 0, 1, 2]
bounds = [-2, -1, 0, 1, 2]
norma = colors.BoundaryNorm(bounds, CustomCmap.N)
for du in range(N_DUS):
for ab in range(N_ABS):
@@ -230,8 +222,8 @@ while check:
print(time.time())
check = False
check_time=time.time() - now
check_time = time.time() - now
print(check_time)
time.sleep(abs(TIT - check_time))
check = True
check = True
Loading