From a9fce73036c59f5b73a79683f8f461b0e2efc2eb Mon Sep 17 00:00:00 2001 From: Alessio Berti Date: Mon, 5 Dec 2022 09:53:28 +0100 Subject: [PATCH 1/2] Check if event coincidence is run over merged DL1 files. --- .../scripts/lst1_magic/lst1_magic_event_coincidence.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/magicctapipe/scripts/lst1_magic/lst1_magic_event_coincidence.py b/magicctapipe/scripts/lst1_magic/lst1_magic_event_coincidence.py index ded7aab0..381c0749 100644 --- a/magicctapipe/scripts/lst1_magic/lst1_magic_event_coincidence.py +++ b/magicctapipe/scripts/lst1_magic/lst1_magic_event_coincidence.py @@ -47,6 +47,7 @@ import logging import sys import time +import re from decimal import Decimal from pathlib import Path @@ -445,6 +446,15 @@ def main(): args = parser.parse_args() + file_regex = re.search(r"Run(\d{5}).h5", args.input_file_lst) + + if file_regex is not None: + logger.error( + "\nRunning event coincidence on a merged LST-1 DL1 file. " + "Please run the script on LST-1 DL1 subrun files, otherwise you may " + "run into memory issues. Exiting." + ) + with open(args.config_file, "rb") as f: config = yaml.safe_load(f) From cf07aacc6cc5e02b87eb208ba6941e785910d9d7 Mon Sep 17 00:00:00 2001 From: Alessio Berti Date: Mon, 5 Dec 2022 09:58:00 +0100 Subject: [PATCH 2/2] Add exit call. --- magicctapipe/scripts/lst1_magic/lst1_magic_event_coincidence.py | 1 + 1 file changed, 1 insertion(+) diff --git a/magicctapipe/scripts/lst1_magic/lst1_magic_event_coincidence.py b/magicctapipe/scripts/lst1_magic/lst1_magic_event_coincidence.py index 381c0749..ea17d4b4 100644 --- a/magicctapipe/scripts/lst1_magic/lst1_magic_event_coincidence.py +++ b/magicctapipe/scripts/lst1_magic/lst1_magic_event_coincidence.py @@ -454,6 +454,7 @@ def main(): "Please run the script on LST-1 DL1 subrun files, otherwise you may " "run into memory issues. Exiting." ) + sys.exit(1) with open(args.config_file, "rb") as f: config = yaml.safe_load(f)