diff --git a/notebooks/AGIPD/AGIPD_Correct_and_Verify.ipynb b/notebooks/AGIPD/AGIPD_Correct_and_Verify.ipynb index 925d9b077ab2dc8309b28ab909089e8ffbbb151f..5d281876528d60adcfb45322d04df70a2ccbc32f 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')" ] }, {