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

Move TableLoader traits to read_...-methods #2482

Merged
merged 16 commits into from
Jan 4, 2024
Merged
18 changes: 10 additions & 8 deletions ctapipe/instrument/tests/test_trigger.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ def test_software_trigger_simtel(allowed_tels):
with EventSource(
path, focal_length_choice="EQUIVALENT", allowed_tels=allowed_tels
) as source:

trigger = SoftwareTrigger(
subarray=source.subarray,
min_telescopes=2,
Expand Down Expand Up @@ -152,7 +151,6 @@ def test_software_trigger_simtel_single_lsts():
with EventSource(
path, focal_length_choice="EQUIVALENT", allowed_tels=allowed_tels
) as source:

trigger = SoftwareTrigger(
subarray=source.subarray,
min_telescopes=2,
Expand Down Expand Up @@ -218,18 +216,22 @@ def test_software_trigger_simtel_process(tmp_path):

with TableLoader(
output_path,
load_simulated=True,
load_dl1_parameters=True,
focal_length_choice="EQUIVALENT",
) as loader:
events_trigger = loader.read_telescope_events("LST_LST_LSTCam")
events_trigger = loader.read_telescope_events(
"LST_LST_LSTCam",
dl2=False,
true_parameters=False,
)

with TableLoader(
output_path_no_software_trigger,
load_simulated=True,
load_dl1_parameters=True,
focal_length_choice="EQUIVALENT",
) as loader:
events_no_trigger = loader.read_telescope_events("LST_LST_LSTCam")
events_no_trigger = loader.read_telescope_events(
"LST_LST_LSTCam",
dl2=False,
true_parameters=False,
)

assert len(events_no_trigger) > len(events_trigger)