From 2d397ab7031a14cda991de09efac5cf317183e7b Mon Sep 17 00:00:00 2001 From: Philipp Schmidt <philipp.schmidt@xfel.eu> Date: Wed, 26 Jul 2023 15:47:11 +0200 Subject: [PATCH] Process all AGIPD trains if PPU device is configured and missing or did not trigger --- notebooks/AGIPD/AGIPD_Correct_and_Verify.ipynb | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/notebooks/AGIPD/AGIPD_Correct_and_Verify.ipynb b/notebooks/AGIPD/AGIPD_Correct_and_Verify.ipynb index 925d9b077..5d2818765 100644 --- a/notebooks/AGIPD/AGIPD_Correct_and_Verify.ipynb +++ b/notebooks/AGIPD/AGIPD_Correct_and_Verify.ipynb @@ -303,10 +303,9 @@ "metadata": {}, "outputs": [], "source": [ - "if use_ppu_device:\n", - " # Obtain trains to process if using a pulse picker device.\n", + "if use_ppu_device and use_ppu_device in dc.control_sources:\n", + " # Obtain trains to process if using a pulse picker device and it's present.\n", "\n", - " # Will throw an uncaught exception if the device is wrong.\n", " seq_start = dc[use_ppu_device, 'trainTrigger.sequenceStart.value'].ndarray()\n", "\n", " # The trains picked are the unique values of trainTrigger.sequenceStart\n", @@ -320,7 +319,11 @@ " ].select_trains(by_id[[train_id]]).ndarray()[0]\n", " train_ids.extend(list(range(train_id, train_id + n_trains)))\n", "\n", - " print(f'PPU device {use_ppu_device} triggered for {len(train_ids)} train(s)')\n", + " if train_ids:\n", + " print(f'PPU device {use_ppu_device} triggered for {len(train_ids)} train(s)')\n", + " else:\n", + " print(f'PPU device {use_ppu_device} not triggered, processing all valid trains')\n", + " train_ids = None\n", "\n", "elif train_ids != [-1]:\n", " # Specific trains passed by parameter, convert to ndarray.\n", @@ -331,7 +334,10 @@ " # Process all trains.\n", " train_ids = None\n", " \n", - " print(f'Processing all valid trains')" + " if use_ppu_device:\n", + " print(f'PPU device {use_ppu_device} configured but not found, processing all valid trains')\n", + " else:\n", + " print(f'Processing all valid trains')" ] }, { -- GitLab