Skip to content

Commit

Permalink
Merge pull request #272 from cta-observatory/exit_coinc
Browse files Browse the repository at this point in the history
Exit coinc
  • Loading branch information
aleberti authored Dec 3, 2024
2 parents 1a505c8 + 266036e commit 3f11d3b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
save_pandas_data_in_table,
telescope_combinations,
)
from magicctapipe.utils import NO_COINCIDENT_EVENTS

__all__ = ["event_coincidence", "telescope_positions"]

Expand Down Expand Up @@ -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)
Expand Down
7 changes: 6 additions & 1 deletion magicctapipe/utils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
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,
Expand All @@ -22,6 +26,7 @@
"MAGICBadPixelsCalc",
"reflected_camera_geometry_mars",
"GENERIC_ERROR_CODE",
"NO_COINCIDENT_EVENTS",
"NO_EVENTS_WITHIN_MAXIMUM_DISTANCE",
"identify_time_edges",
"intersect_time_intervals",
Expand Down
1 change: 1 addition & 0 deletions magicctapipe/utils/error_codes.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@

GENERIC_ERROR_CODE = 1
NO_EVENTS_WITHIN_MAXIMUM_DISTANCE = 2
NO_COINCIDENT_EVENTS = 3

0 comments on commit 3f11d3b

Please sign in to comment.