diff --git a/notebooks/Gotthard2/Characterize_Darks_Gotthard2_NBC.ipynb b/notebooks/Gotthard2/Characterize_Darks_Gotthard2_NBC.ipynb index 6e667a75668866251978934b081c417a649c930a..09073da32f15e0f6ff88894b4efb34f1f9e4afc5 100644 --- a/notebooks/Gotthard2/Characterize_Darks_Gotthard2_NBC.ipynb +++ b/notebooks/Gotthard2/Characterize_Darks_Gotthard2_NBC.ipynb @@ -129,7 +129,7 @@ "run_dc = RunDirectory(in_folder / f\"r{run_high:04d}\")\n", "file_loc = f\"proposal:{run_dc.run_metadata()['proposalNumber']} runs:{run_high} {run_med} {run_low}\" # noqa\n", "receiver_names = [f\"*{receiver_template.format(x)}*\" for x in receiver_affixes]\n", - "data_sources = list(run_dc.select(receiver_names).all_sources)" + "data_sources = sorted(list(run_dc.select(receiver_names).all_sources))" ] }, { @@ -313,7 +313,14 @@ " np.uint16\n", ")\n", "empty_lut = np.stack(1280 * [np.stack([empty_lut] * 2)], axis=0)\n", - "for mod, src in zip(karabo_da, data_sources):\n", + "for mod in karabo_da:\n", + "\n", + " # A temporar workaround for using the correct data_source\n", + " if gh2_detector == \"25um\":\n", + " # Bad assumption for CALCAT DA names e.g. GH200/1 and GH200/2\n", + " src = data_sources[int(mod[-1])-1]\n", + " else:\n", + " src = data_sources[0]\n", "\n", " # Retrieve LUT constant\n", " lut, time = get_constant_from_db_and_time(\n", diff --git a/notebooks/Gotthard2/Correction_Gotthard2_NBC.ipynb b/notebooks/Gotthard2/Correction_Gotthard2_NBC.ipynb index e4153353f962fd9772e78b640b0889c85bf57dd1..e7c85a868152a875d0b214f5fdaef8c62bd870e0 100644 --- a/notebooks/Gotthard2/Correction_Gotthard2_NBC.ipynb +++ b/notebooks/Gotthard2/Correction_Gotthard2_NBC.ipynb @@ -242,7 +242,7 @@ "\n", "# Create the correction receiver name.\n", "receiver_names = [f\"*{receiver_template.format(x)}*\" for x in receiver_affixes]\n", - "data_sources = list(run_dc.select(receiver_names).all_sources)\n", + "data_sources = sorted(list(run_dc.select(receiver_names).all_sources))\n", "\n", "if not corr_receiver:\n", " # This part assumes this data_source structure: '{karabo_id}/DET/{receiver_name}:{output_channel}'\n",