diff --git a/notebooks/AGIPD/AGIPD_Correct_and_Verify.ipynb b/notebooks/AGIPD/AGIPD_Correct_and_Verify.ipynb index aa8611fe046d1b4561c67af83764dc075758a47c..86a529138f328b3aa206c342b9511f1cea950ddf 100644 --- a/notebooks/AGIPD/AGIPD_Correct_and_Verify.ipynb +++ b/notebooks/AGIPD/AGIPD_Correct_and_Verify.ipynb @@ -549,6 +549,7 @@ " Metadata for constants is taken from yml file or retrieved from the DB\n", " \"\"\"\n", " k_da = module_index_to_karabo_da[mod]\n", + " # check if there is a yaml file in out_folder that has the device constants.\n", "\n", " if k_da in const_yaml:\n", " when = agipd_corr.initialize_from_yaml(k_da, const_yaml, mod)\n", @@ -569,10 +570,12 @@ " client=rest_cfg.calibration_client(),\n", " )\n", " print(f\"Queried CalCat for {k_da}\")\n", + "\n", " # `when` is expected to be None if dark constants are not available\n", " # and correction should be skipped for this module.\n", " return mod, when, k_da\n", "\n", + "\n", "print(f'Preparing constants (FF: {agipd_corr.corr_bools.get(\"xray_corr\", False)}, PC: {any(agipd_corr.pc_bools)}, '\n", " f'BLC: {any(agipd_corr.blc_bools)})')\n", "step_timer.start()\n", @@ -792,50 +795,6 @@ "step_timer.print_summary()" ] }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# if the yml file contains \"retrieved-constants\", that means a leading\n", - "# notebook got processed and the reporting would be generated from it.\n", - "fst_print = True\n", - "timestamps = {}\n", - "\n", - "for i, (modno, when, k_da) in enumerate(const_out):\n", - " qm = module_index_to_qm(modno)\n", - "\n", - " if k_da not in const_yaml:\n", - " if fst_print:\n", - " print(\"Constants are retrieved with creation time: \")\n", - " fst_print = False\n", - "\n", - " module_timestamps = {}\n", - "\n", - " print(f\"{qm}:\")\n", - " for key, item in when.items():\n", - " if hasattr(item, 'strftime'):\n", - " item = item.strftime('%y-%m-%d %H:%M')\n", - " when[key] = item\n", - " print('{:.<12s}'.format(key), item)\n", - "\n", - " # Store few time stamps if exists\n", - " # Add NA to keep array structure\n", - " for key in ['Offset', 'SlopesPC', 'SlopesFF']:\n", - " if when and key in when and when[key]:\n", - " module_timestamps[key] = when[key]\n", - " else:\n", - " module_timestamps[key] = \"NA\"\n", - " timestamps[qm] = module_timestamps\n", - "\n", - "seq = sequences[0] if sequences else 0\n", - "\n", - "if timestamps:\n", - " with open(f\"{out_folder}/retrieved_constants_s{seq}.yml\",\"w\") as fd:\n", - " yaml.safe_dump({\"time-summary\": {f\"S{seq}\": timestamps}}, fd)" - ] - }, { "cell_type": "code", "execution_count": null,