diff --git a/magicctapipe/io/containers.py b/magicctapipe/io/containers.py index 7cc2c5668..0f909f943 100644 --- a/magicctapipe/io/containers.py +++ b/magicctapipe/io/containers.py @@ -26,7 +26,7 @@ class BaseEventInfoContainer(Container): pointing_az = Field(DEFAULT_RAD, "Azimuth of the pointing direction", unit="rad") n_pixels = Field(DEFAULT_VALUE, "Number of pixels after the image cleaning") n_islands = Field(DEFAULT_VALUE, "Number of islands after the image cleaning") - tels_with_trigger = Field(None, "Boolean np array (True = telescope triggered by event)") + tels_with_trigger = Field(None, "Integer indicating the combination of telescopes that triggered") class RealEventInfoContainer(BaseEventInfoContainer): diff --git a/magicctapipe/scripts/lst1_magic/magic_calib_to_dl1.py b/magicctapipe/scripts/lst1_magic/magic_calib_to_dl1.py index 9ff7a9a5e..a9022aeed 100644 --- a/magicctapipe/scripts/lst1_magic/magic_calib_to_dl1.py +++ b/magicctapipe/scripts/lst1_magic/magic_calib_to_dl1.py @@ -58,6 +58,7 @@ from ctapipe_io_magic import MAGICEventSource from magicctapipe.image import MAGICClean from magicctapipe.io import RealEventInfoContainer, SimEventInfoContainer, format_object +from magicctapipe.io.io import TEL_COMBINATIONS from magicctapipe.utils import calculate_disp, calculate_impact __all__ = ["magic_calib_to_dl1"] @@ -337,17 +338,15 @@ def magic_calib_to_dl1(input_file, output_dir, config, process_run=False): event_info.tel_id = 3 # MAGIC-II if event.trigger.tels_with_trigger == [1, 2]: - tels_with_trigger_magic_lst = [2, 3] + tels_with_trigger_magic_lst = list(TEL_COMBINATIONS.values()).index([2, 3]) # M1+M2 elif event.trigger.tels_with_trigger == [2, 3]: - tels_with_trigger_magic_lst = [1, 3] + tels_with_trigger_magic_lst = list(TEL_COMBINATIONS.values()).index([1, 3]) # M2+LST elif event.trigger.tels_with_trigger == [1, 3]: - tels_with_trigger_magic_lst = [1, 2] + tels_with_trigger_magic_lst = list(TEL_COMBINATIONS.values()).index([1, 2]) # M1+LST elif event.trigger.tels_with_trigger == [1, 2, 3]: - tels_with_trigger_magic_lst = [1, 2, 3] + tels_with_trigger_magic_lst = list(TEL_COMBINATIONS.values()).index([1, 2, 3]) # M1+M2+LST - tels_with_trigger_mask = subarray_magic.tel_ids_to_mask(tels_with_trigger_magic_lst) - - event_info.tels_with_trigger = tels_with_trigger_mask + event_info.tels_with_trigger = tels_with_trigger_magic_lst # Save the parameters to the output file writer.write(