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

Use daqparser

parent 170c9f64
Branches
Tags
No related merge requests found
...@@ -56,22 +56,15 @@ class DOMActivityPlotter(kp.Module): ...@@ -56,22 +56,15 @@ class DOMActivityPlotter(kp.Module):
if self.index % 30: if self.index % 30:
return blob return blob
tag = str(blob['CHPrefix'].tag) if 'RawSummaryslice' in blob:
summaryslice = blob['RawSummaryslice']
timestamp = summaryslice.header.time_stamp
if tag != 'IO_SUM': for dom_id, _ in summaryslice.summary_frames.items():
return blob du, dom, _ = self.detector.doms[dom_id]
self.last_activity[(du, dom)] = timestamp
data = blob['CHData']
data_io = BytesIO(data)
preamble = kp.io.daq.DAQPreamble(file_obj=data_io) # noqa
summaryslice = kp.io.daq.DAQSummaryslice(file_obj=data_io)
timestamp = summaryslice.header.time_stamp
for dom_id, _ in summaryslice.summary_frames.items():
du, dom, _ = self.detector.doms[dom_id]
self.last_activity[(du, dom)] = timestamp
self.cuckoo.msg() self.cuckoo.msg()
return blob return blob
......
...@@ -57,16 +57,14 @@ class MonitorRates(kp.Module): ...@@ -57,16 +57,14 @@ class MonitorRates(kp.Module):
if self.index % 30: if self.index % 30:
return blob return blob
data = blob['CHData'] if 'RawSummaryslice' in blob:
data_io = BytesIO(data) summaryslice = blob['RawSummaryslice']
preamble = kp.io.daq.DAQPreamble(file_obj=data_io) # noqa self.rates = {} # TODO: review this hack
summaryslice = kp.io.daq.DAQSummaryslice(file_obj=data_io) for dom_id, rates in summaryslice.summary_frames.items():
self.rates = {} # TODO: review this hack du, dom, _ = self.detector.doms[dom_id]
for dom_id, rates in summaryslice.summary_frames.items(): self.rates[(du, dom)] = np.sum(rates) / 1000
du, dom, _ = self.detector.doms[dom_id]
self.rates[(du, dom)] = np.sum(rates) / 1000 self.cuckoo.msg()
self.cuckoo.msg()
return blob return blob
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment