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

Add support for newer Jpp files

parent a462a0bc
No related branches found
Tags v1.1
No related merge requests found
Pipeline #9383 passed with warnings
......@@ -6,6 +6,8 @@ import numba as nb
TIMESLICE_FRAME_BASKET_CACHE_SIZE = 523 * 1024**2 # [byte]
SUMMARYSLICE_FRAME_BASKET_CACHE_SIZE = 523 * 1024**2 # [byte]
BASKET_CACHE_SIZE = 110 * 1024**2
BASKET_CACHE = uproot.cache.ThreadSafeArrayCache(BASKET_CACHE_SIZE)
# Parameters for PMT rate conversions, since the rates in summary slices are
# stored as a single byte to save space. The values from 0-255 can be decoded
......@@ -259,6 +261,17 @@ class DAQTimesliceStream:
self.superframes = superframes
self._hits_buffer = hits_buffer
# def frames(self):
# n_hits = self._superframe[
# b'vector<KM3NETDAQ::JDAQSuperFrame>.numberOfHits'].lazyarray(
# basketcache=BASKET_CACHE)[self._idx]
# module_ids = self._superframe[
# b'vector<KM3NETDAQ::JDAQSuperFrame>.id'].lazyarray(basketcache=BASKET_CACHE)[self._idx]
# idx = 0
# for module_id, n_hits in zip(module_ids, n_hits):
# self._frames[module_id] = hits_buffer[idx:idx + n_hits]
# idx += n_hits
class DAQTimeslice:
"""A wrapper for a DAQ timeslice"""
......@@ -281,10 +294,17 @@ class DAQTimeslice:
"""Populate a dictionary of frames with the module ID as key"""
hits_buffer = self._hits_buffer[self._idx]
n_hits = self._superframe[
b'vector<KM3NETDAQ::JDAQSuperFrame>.numberOfHits'].lazyarray()[
b'vector<KM3NETDAQ::JDAQSuperFrame>.numberOfHits'].lazyarray(basketcache=BASKET_CACHE)[
self._idx]
module_ids = self._superframe[
b'vector<KM3NETDAQ::JDAQSuperFrame>.id'].lazyarray()[self._idx]
try:
module_ids = self._superframe[
b'vector<KM3NETDAQ::JDAQSuperFrame>.id'].lazyarray(
basketcache=BASKET_CACHE)[self._idx]
except KeyError:
module_ids = self._superframe[
b'vector<KM3NETDAQ::JDAQSuperFrame>.KM3NETDAQ::JDAQModuleIdentifier'].lazyarray(
basketcache=BASKET_CACHE)[self._idx]
idx = 0
for module_id, n_hits in zip(module_ids, n_hits):
self._frames[module_id] = hits_buffer[idx:idx + n_hits]
......@@ -294,7 +314,7 @@ class DAQTimeslice:
if self._n_frames is None:
self._n_frames = len(
self._superframe[b'vector<KM3NETDAQ::JDAQSuperFrame>.id'].
lazyarray()[self._idx])
lazyarray(basketcache=BASKET_CACHE)[self._idx])
return self._n_frames
def __str__(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment