Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always fill tels_with_trigger #202

Merged
merged 2 commits into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/ctapipe_io_lst/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -630,9 +630,7 @@ def _generator(self):
else:
self.fill_r0r1_container(array_event, zfits_event)
self.fill_lst_event_container(array_event, zfits_event)

if self.trigger_information:
self.fill_trigger_info(array_event)
self.fill_trigger_info(array_event)

self.fill_mon_container(array_event, zfits_event)

Expand Down Expand Up @@ -878,8 +876,12 @@ def fill_trigger_info(self, array_event):
tel_id = self.tel_id

trigger = array_event.trigger
trigger.time = self.time_calculator(tel_id, array_event)
trigger.tels_with_trigger = [tel_id]

if not self.trigger_information:
return

trigger.time = self.time_calculator(tel_id, array_event)
trigger.tel[tel_id].time = trigger.time

lst = array_event.lst.tel[tel_id]
Expand Down
5 changes: 4 additions & 1 deletion src/ctapipe_io_lst/tests/test_calib.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import pytest
import pickle
from ctapipe_io_lst.constants import HIGH_GAIN
import os
Expand Down Expand Up @@ -136,12 +137,14 @@ def test_source_with_calibration():
assert event.r1.tel[1].waveform is not None


def test_source_with_all():
@pytest.mark.parametrize("trigger_information", [True, False])
def test_source_with_all(trigger_information):
from ctapipe_io_lst import LSTEventSource

config = Config({
'LSTEventSource': {
'pointing_information': False,
'trigger_information': trigger_information,
'LSTR0Corrections': {
'drs4_pedestal_path': test_drs4_pedestal_path,
'drs4_time_calibration_path': test_time_calib_path,
Expand Down
Loading