Skip to content
Snippets Groups Projects

added last_invalid_packet_exception and removed subband logging function

Merged Taya Snijder requested to merge L2SS-936_xst_logging into main
Files
3
@@ -25,7 +25,6 @@ This includes:
import abc
import logging
import datetime
import numpy
@@ -59,6 +58,8 @@ class StatisticsCollector(abc.ABC):
"nof_invalid_packets": numpy.uint64(0),
# Full contents of the latest packet we deemed invalid.
"last_invalid_packet": numpy.zeros((9000,), dtype=numpy.uint8),
# Track the last invalid packet
"last_invalid_packet_exception": None,
}
def process_packet(self, packet):
@@ -74,6 +75,8 @@ class StatisticsCollector(abc.ABC):
)
self.parameters["nof_invalid_packets"] += numpy.uint64(1)
self.parameters["last_invalid_packet_exception"] = err
raise ValueError("Could not parse statistics packet") from err
@abc.abstractmethod
@@ -325,9 +328,6 @@ class XSTCollector(StatisticsCollector):
f"{fields.subband_index}."
)
# log if we're replacing a subband we were once recording
self._log_replacing_subband(subband_slot, fields)
# the payload contains complex values for the block of baselines of size
# BLOCK_LENGTH x BLOCK_LENGTH starting at baseline first_baseline.
#
@@ -363,20 +363,6 @@ class XSTCollector(StatisticsCollector):
subband_slot
] = fields.integration_interval()
def _log_replacing_subband(self, subband_slot, fields):
# log if we're replacing a subband we were once recording
previous_subband_in_slot = self.parameters["xst_subbands"][subband_slot]
if previous_subband_in_slot != fields.subband_index:
if self.parameters["xst_timestamps"][subband_slot] > 0:
previous_subband_timestamp = datetime.datetime.fromtimestamp(
self.parameters["xst_timestamps"][subband_slot]
)
logger.info(
f"Stopped recording XSTs for subband {previous_subband_in_slot}. "
"Last data for this subband was received at "
f"{previous_subband_timestamp}."
)
def xst_values(self, subband_indices=None):
"""xst_blocks, but as a matrix[len(subband_indices)][MAX_INPUTS][MAX_INPUTS]
Loading