From 30ae788ccf3357326be81c421699e43b5d6443e3 Mon Sep 17 00:00:00 2001 From: David Hammer <dhammer@mailbox.org> Date: Wed, 26 Jan 2022 21:25:52 +0100 Subject: [PATCH] Handle cell table being empty bytearray... --- src/calng/base_correction.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/calng/base_correction.py b/src/calng/base_correction.py index 33f208a6..3873d34c 100644 --- a/src/calng/base_correction.py +++ b/src/calng/base_correction.py @@ -957,7 +957,10 @@ class BaseCorrection(PythonDevice): train_id = metadata.getAttribute("timestamp", "tid") cell_table = data_hash.get(self._cell_table_path) - if cell_table.size == 0: + if ( + (isinstance(cell_table, np.ndarray) and cell_table.size == 0) + or len(cell_table) == 0 + ): self.log_status_warn( "Empty cell table, DAQ probably not sending data." ) -- GitLab