diff --git a/notebooks/AGIPD/AGIPD_Correct_and_Verify.ipynb b/notebooks/AGIPD/AGIPD_Correct_and_Verify.ipynb index eaed1327aa54899886e988f332a6e046bfd1dd14..f4561c410785277edeb1874e218bc5c4cdefced7 100644 --- a/notebooks/AGIPD/AGIPD_Correct_and_Verify.ipynb +++ b/notebooks/AGIPD/AGIPD_Correct_and_Verify.ipynb @@ -66,7 +66,9 @@ "\n", "# Correction Booleans\n", "only_offset = False # Apply only Offset correction. if False, Offset is applied by Default. if True, Offset is only applied.\n", - "rel_gain = \"off\" # Select relative gain correction. Choices [`PC`, `CS`, `off`]. (`PC`: Pulse Capacitor, `CS`: Current Source, `off`: Disable relative gain correction). Default: off.\n", + "# TODO: Remove this boolean parameter an replace rel_gain_mode with it.\n", + "rel_gain = False \n", + "rel_gain_mode = \"off\" # Select relative gain correction. Choices [`PC`, `CS`, `off`]. (`PC`: Pulse Capacitor, `CS`: Current Source, `off`: Disable relative gain correction). Default: off.\n", "xray_gain = False # do relative gain correction based on xray data\n", "blc_noise = False # if set, baseline correction via noise peak location is attempted\n", "blc_stripes = False # if set, baseline corrected via stripes\n", @@ -213,6 +215,13 @@ "# Here the hierarchy and dependability for correction booleans are defined\n", "corr_bools = {}\n", "\n", + "# TODO: Remove this part after replacing rel_gain with rel_gain_mode\n", + "if rel_gain_mode == 'off':\n", + " if rel_gain:\n", + " rel_gain = 'pc'\n", + "else:\n", + " rel_gain == rel_gain_mode\n", + "\n", "# offset is at the bottom of AGIPD correction pyramid.\n", "corr_bools[\"only_offset\"] = only_offset\n", "rel_gain = rel_gain.lower()\n", @@ -220,7 +229,7 @@ "# Dont apply any corrections if only_offset is requested\n", "if not only_offset:\n", " corr_bools[\"adjust_mg_baseline\"] = adjust_mg_baseline\n", - " corr_bools[\"rel_gain\"] = rel_gain # This is not a boolean anymore.\n", + " corr_bools[\"rel_gain\"] = rel_gain # This is not a boolean.\n", " corr_bools[\"xray_corr\"] = xray_gain\n", " corr_bools[\"blc_noise\"] = blc_noise\n", " corr_bools[\"blc_stripes\"] = blc_stripes\n", diff --git a/notebooks/AGIPD/AGIPD_Correct_and_Verify_Summary_NBC.ipynb b/notebooks/AGIPD/AGIPD_Correct_and_Verify_Summary_NBC.ipynb index 7c3aba0dff2482aae2997f3ad1e3a0ca58503218..17a162ea0017533e62fa34002537908032c46654 100644 --- a/notebooks/AGIPD/AGIPD_Correct_and_Verify_Summary_NBC.ipynb +++ b/notebooks/AGIPD/AGIPD_Correct_and_Verify_Summary_NBC.ipynb @@ -19,7 +19,7 @@ "karabo_id = \"SPB_DET_AGIPD1M-1\" # karabo karabo_id\n", "modules = [-1]\n", "karabo_da = ['-1'] # a list of data aggregators names, Default [-1] for selecting all data aggregators\n", - "rel_gain = \"off\" # Select relative gain correction. Choices [`PC`, `CS`, `off`]. (`PC`: Pulse Capacitor, `CS`: Current Source, `off`: Disable relative gain correction). Default: off." + "rel_gain_mode = \"off\" # Select relative gain correction. Choices [`PC`, `CS`, `off`]. (`PC`: Pulse Capacitor, `CS`: Current Source, `off`: Disable relative gain correction). Default: off." ] }, { @@ -106,7 +106,7 @@ " display(Latex(tabulate.tabulate(table,\n", " tablefmt=\"latex\",\n", " headers=[\"Timestamps\", \"Modules and sequences\"])))\n", - "rel_gain_alias = \"CS\" if rel_gain.lower() == \"cs\" else \"PC\"\n", + "rel_gain_alias = \"CS\" if rel_gain_mode.lower() == \"cs\" else \"PC\" # 'off' or 'pc'\n", "for const in ['Offset', f'Slopes{rel_gain_alias}', 'SlopesFF']:\n", " print_const_table(const)" ] diff --git a/webservice/update_config.py b/webservice/update_config.py index 92863dac872b25a108ed1fe666ac59d8a0051654..f1ae56d369ddbadf4e0d6ca2d158593b9fe47941 100755 --- a/webservice/update_config.py +++ b/webservice/update_config.py @@ -15,7 +15,7 @@ AGIPD_CONFIGURATIONS = { { "common-mode": {'type': bool}, "force-hg-if-below": {'type': int}, - "rel-gain": {'type': str}, + "rel-gain": {'type': bool}, "xray-gain": {'type': bool}, "blc-noise": {'type': bool}, "blc-set-min": {'type': bool},