From 50b832c3361fcc5a954048d3a46ee062a530d4e5 Mon Sep 17 00:00:00 2001 From: Elisa-Visentin <121040436+Elisa-Visentin@users.noreply.github.com> Date: Tue, 26 Nov 2024 08:29:45 +0100 Subject: [PATCH 1/5] Update error_codes.py --- magicctapipe/utils/error_codes.py | 1 + 1 file changed, 1 insertion(+) diff --git a/magicctapipe/utils/error_codes.py b/magicctapipe/utils/error_codes.py index fa61bb8f..b8a15bf2 100644 --- a/magicctapipe/utils/error_codes.py +++ b/magicctapipe/utils/error_codes.py @@ -8,3 +8,4 @@ GENERIC_ERROR_CODE = 1 NO_EVENTS_WITHIN_MAXIMUM_DISTANCE = 2 +NO_COINCIDENT_EVENTS = 3 From 4c166e72d18ae4dce6dec8a024f283be87cc3838 Mon Sep 17 00:00:00 2001 From: Elisa-Visentin <121040436+Elisa-Visentin@users.noreply.github.com> Date: Tue, 26 Nov 2024 08:31:44 +0100 Subject: [PATCH 2/5] Update __init__.py --- magicctapipe/utils/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/magicctapipe/utils/__init__.py b/magicctapipe/utils/__init__.py index 82247027..002a6ae1 100644 --- a/magicctapipe/utils/__init__.py +++ b/magicctapipe/utils/__init__.py @@ -1,6 +1,6 @@ from .badpixels import MAGICBadPixelsCalc from .camera_geometry import reflected_camera_geometry_mars -from .error_codes import GENERIC_ERROR_CODE, NO_EVENTS_WITHIN_MAXIMUM_DISTANCE +from .error_codes import GENERIC_ERROR_CODE, NO_COINCIDENT_EVENTS, NO_EVENTS_WITHIN_MAXIMUM_DISTANCE from .functions import ( HEIGHT_ORM, LAT_ORM, @@ -22,6 +22,7 @@ "MAGICBadPixelsCalc", "reflected_camera_geometry_mars", "GENERIC_ERROR_CODE", + "NO_COINCIDENT_EVENTS", "NO_EVENTS_WITHIN_MAXIMUM_DISTANCE", "identify_time_edges", "intersect_time_intervals", From 110d37cc83e567b1c6a027dc069dbd9bae3a8cd2 Mon Sep 17 00:00:00 2001 From: Elisa-Visentin <121040436+Elisa-Visentin@users.noreply.github.com> Date: Tue, 26 Nov 2024 08:35:35 +0100 Subject: [PATCH 3/5] Update lst1_magic_event_coincidence.py --- .../scripts/lst1_magic/lst1_magic_event_coincidence.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/magicctapipe/scripts/lst1_magic/lst1_magic_event_coincidence.py b/magicctapipe/scripts/lst1_magic/lst1_magic_event_coincidence.py index 702280ef..4f5ebd6c 100644 --- a/magicctapipe/scripts/lst1_magic/lst1_magic_event_coincidence.py +++ b/magicctapipe/scripts/lst1_magic/lst1_magic_event_coincidence.py @@ -81,6 +81,7 @@ save_pandas_data_in_table, telescope_combinations, ) +from magicctapipe.utils import NO_COINCIDENT_EVENTS __all__ = ["event_coincidence", "telescope_positions"] @@ -525,7 +526,7 @@ def event_coincidence(input_file_lst, input_dir_magic, output_dir, config): if event_data.empty: logger.info("\nNo coincident events are found. Exiting...") - sys.exit() + sys.exit(NO_COINCIDENT_EVENTS) event_data.sort_index(inplace=True) event_data.drop_duplicates(inplace=True) From ad8d22055dd9133060bc25b19bfabfcb3bdeab4d Mon Sep 17 00:00:00 2001 From: Elisa-Visentin <121040436+Elisa-Visentin@users.noreply.github.com> Date: Tue, 26 Nov 2024 08:41:45 +0100 Subject: [PATCH 4/5] Update __init__.py --- magicctapipe/utils/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/magicctapipe/utils/__init__.py b/magicctapipe/utils/__init__.py index 002a6ae1..6e6dd1c4 100644 --- a/magicctapipe/utils/__init__.py +++ b/magicctapipe/utils/__init__.py @@ -1,6 +1,10 @@ from .badpixels import MAGICBadPixelsCalc from .camera_geometry import reflected_camera_geometry_mars -from .error_codes import GENERIC_ERROR_CODE, NO_COINCIDENT_EVENTS, NO_EVENTS_WITHIN_MAXIMUM_DISTANCE +from .error_codes import ( + GENERIC_ERROR_CODE, + NO_COINCIDENT_EVENTS, + NO_EVENTS_WITHIN_MAXIMUM_DISTANCE +) from .functions import ( HEIGHT_ORM, LAT_ORM, From 266036ed1238f61b3283d0d6f1934ec999989ec3 Mon Sep 17 00:00:00 2001 From: Elisa-Visentin <121040436+Elisa-Visentin@users.noreply.github.com> Date: Tue, 26 Nov 2024 08:43:16 +0100 Subject: [PATCH 5/5] Update __init__.py --- magicctapipe/utils/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/magicctapipe/utils/__init__.py b/magicctapipe/utils/__init__.py index 6e6dd1c4..fc2e4a86 100644 --- a/magicctapipe/utils/__init__.py +++ b/magicctapipe/utils/__init__.py @@ -3,7 +3,7 @@ from .error_codes import ( GENERIC_ERROR_CODE, NO_COINCIDENT_EVENTS, - NO_EVENTS_WITHIN_MAXIMUM_DISTANCE + NO_EVENTS_WITHIN_MAXIMUM_DISTANCE, ) from .functions import ( HEIGHT_ORM,