Skip to content
Snippets Groups Projects
Commit b0bbc3fc authored by Tamas Gal's avatar Tamas Gal :speech_balloon:
Browse files

Make rates settable

parent eab4b602
Branches
Tags
No related merge requests found
...@@ -31,16 +31,18 @@ import km3pipe as kp ...@@ -31,16 +31,18 @@ import km3pipe as kp
import km3pipe.style import km3pipe.style
from km3modules.plot import plot_dom_parameters from km3modules.plot import plot_dom_parameters
VERSION = "1.0" VERSION = "1.0"
km3pipe.style.use('km3pipe') km3pipe.style.use('km3pipe')
class MonitorRates(kp.Module): class DOMRates(kp.Module):
"""Creates a coloured dot for each DOM, representing their rates.""" """Creates a coloured dot for each DOM, representing their rates."""
def configure(self): def configure(self):
self.plots_path = self.require('plots_path') self.plots_path = self.require('plots_path')
det_id = self.require('det_id') det_id = self.require('det_id')
self.lowest_rate = self.get("lowest_rate", default=200)
self.highest_rate = self.get("highest_rate", default=400)
self.detector = kp.hardware.Detector(det_id=det_id) self.detector = kp.hardware.Detector(det_id=det_id)
self.index = 0 self.index = 0
...@@ -73,12 +75,18 @@ class MonitorRates(kp.Module): ...@@ -73,12 +75,18 @@ class MonitorRates(kp.Module):
print(self.__class__.__name__ + ": updating plot.") print(self.__class__.__name__ + ": updating plot.")
filename = os.path.join(self.plots_path, 'dom_rates.png') filename = os.path.join(self.plots_path, 'dom_rates.png')
plot_dom_parameters(self.rates, self.detector, filename, plot_dom_parameters(
'rate [kHz]', self.rates,
"DOM Rates", self.detector,
vmin=200, vmax=400, filename,
cmap='coolwarm', missing='black', 'rate [kHz]',
under='darkorchid', over='deeppink') "DOM Rates",
vmin=self.lowest_rate,
vmax=self.highest_rate,
cmap='coolwarm',
missing='black',
under='darkorchid',
over='deeppink')
print("done") print("done")
...@@ -92,13 +100,15 @@ def main(): ...@@ -92,13 +100,15 @@ def main():
ligier_port = int(args['-p']) ligier_port = int(args['-p'])
pipe = kp.Pipeline() pipe = kp.Pipeline()
pipe.attach(kp.io.ch.CHPump, host=ligier_ip, pipe.attach(
port=ligier_port, kp.io.ch.CHPump,
tags='IO_SUM', host=ligier_ip,
timeout=60*60*24*7, port=ligier_port,
max_queue=2000) tags='IO_SUM',
timeout=60 * 60 * 24 * 7,
max_queue=2000)
pipe.attach(kp.io.daq.DAQProcessor) pipe.attach(kp.io.daq.DAQProcessor)
pipe.attach(MonitorRates, det_id=det_id, plots_path=plots_path) pipe.attach(DOMRates, det_id=det_id, plots_path=plots_path)
pipe.drain() pipe.drain()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment