From 9ac8739f5e512c476514b11e009b61c993f02b11 Mon Sep 17 00:00:00 2001 From: Maximilian Linhoff Date: Tue, 21 Nov 2023 16:59:26 +0100 Subject: [PATCH] Also reset r1 event type in check_pedestals --- src/ctapipe_io_lst/__init__.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/ctapipe_io_lst/__init__.py b/src/ctapipe_io_lst/__init__.py index 1fd94115..e6d58fb8 100644 --- a/src/ctapipe_io_lst/__init__.py +++ b/src/ctapipe_io_lst/__init__.py @@ -1142,15 +1142,19 @@ def check_interleaved_pedestal(self, array_event): event_id = array_event.index.event_id if event_id in self.pedestal_ids: - array_event.trigger.event_type = EventType.SKY_PEDESTAL + event_type = EventType.SKY_PEDESTAL self.log.debug("Event %d is an interleaved pedestal", event_id) - elif array_event.trigger.event_type == EventType.SKY_PEDESTAL: # wrongly tagged pedestal event must be cosmic, since it would # have been changed to flatfield by the flatfield tagging if ff - array_event.trigger.event_type = EventType.SUBARRAY + event_type = EventType.SUBARRAY self.log.debug( "Event %d is tagged as pedestal but not a known pedestal event", event_id, ) + else: + return + array_event.trigger.event_type = EventType + if CTAPIPE_0_20: + array_event.r1.tel[self.tel_id].event_type = event_type