From 6cc008f8417db60bfef991df5ecfd2861d31aa71 Mon Sep 17 00:00:00 2001 From: Artur Glavic Date: Thu, 9 Jul 2026 10:27:24 +0200 Subject: [PATCH] Update revision for release --- eos/event_handling.py | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/eos/event_handling.py b/eos/event_handling.py index 4f0437c..bcd42c8 100644 --- a/eos/event_handling.py +++ b/eos/event_handling.py @@ -197,18 +197,19 @@ class ApplyMask(EventDataAction): logging.info(f' number of events: total = {pre_filter:7d}, after filtering = {post_filter:7d}') if d.device_logs == {} or not hasattr(dataset, 'update_info_from_logs'): return - # filter pulses and logs to allow update of header information - from .helpers import add_log_to_pulses - times = np.unique(d.events.wallTime) - # make sure all log variables are associated with pulses - for key, log in d.device_logs.items(): - if not key in d.pulses.dtype.names: - # interpolate the parameter values for all existing pulses - add_log_to_pulses(key, dataset) - # remove all pulses that have no more events - d.pulses = d.pulses[np.isin(d.pulses.time, times)] - for key, log in d.device_logs.items(): - d.device_logs[key] = np.recarray(d.pulses.shape, dtype = log.dtype) - d.device_logs[key].time = d.pulses.time - d.device_logs[key].value = d.pulses[key] - dataset.update_info_from_logs() + if 'wallTime' in d.events.dtype.names: + # filter pulses and logs to allow update of header information + from .helpers import add_log_to_pulses + times = np.unique(d.events.wallTime) + # make sure all log variables are associated with pulses + for key, log in d.device_logs.items(): + if not key in d.pulses.dtype.names: + # interpolate the parameter values for all existing pulses + add_log_to_pulses(key, dataset) + # remove all pulses that have no more events + d.pulses = d.pulses[np.isin(d.pulses.time, times)] + for key, log in d.device_logs.items(): + d.device_logs[key] = np.recarray(d.pulses.shape, dtype = log.dtype) + d.device_logs[key].time = d.pulses.time + d.device_logs[key].value = d.pulses[key] + dataset.update_info_from_logs()