From 47643539fce2ebde17076c6190c038674aeb32aa Mon Sep 17 00:00:00 2001
From: Johannes Schumann <johannes.schumann@fau.de>
Date: Thu, 16 Jan 2020 17:13:18 +0100
Subject: [PATCH] Has UDP trailer

---
 km3io/daq.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/km3io/daq.py b/km3io/daq.py
index 8694728..8fcc7ff 100644
--- a/km3io/daq.py
+++ b/km3io/daq.py
@@ -29,7 +29,11 @@ def get_rate(value):
 
 def get_number_udp_packets(value):
     """Return the number of received UDP packets based on the dq_status value"""
-    return value & 0x7FFF
+    return np.bitwise_and(value & 0x7FFF)
+
+def has_udp_trailer(value)
+    """Returns the UDP Trailer flag based on on the fifo field value"""
+    return np.any(np.bitwise_and(value, np.leftshift(1,31)))
 
 class DAQReader:
     """Reader for DAQ ROOT files"""
-- 
GitLab