From 63bc7a01ff1b59718ac5ea3b1aedd6475c44d020 Mon Sep 17 00:00:00 2001 From: ahmedk <karim.ahmed@xfel.eu> Date: Thu, 28 Apr 2022 13:45:35 +0200 Subject: [PATCH] -1 as default condition value and correct dtype for conditions in the first cell --- .../AGIPD/Chracterize_AGIPD_Gain_PC_NBC.ipynb | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/notebooks/AGIPD/Chracterize_AGIPD_Gain_PC_NBC.ipynb b/notebooks/AGIPD/Chracterize_AGIPD_Gain_PC_NBC.ipynb index 7f036cde4..8f22ce284 100644 --- a/notebooks/AGIPD/Chracterize_AGIPD_Gain_PC_NBC.ipynb +++ b/notebooks/AGIPD/Chracterize_AGIPD_Gain_PC_NBC.ipynb @@ -53,11 +53,11 @@ "local_output = True # output constants locally\n", "db_output = False # output constants to database\n", "\n", - "bias_voltage = 300 # detector bias voltage\n", - "mem_cells = 0. # number of memory cells used, use 0 to auto-derive\n", - "acq_rate = 0. # the detector acquisition rate, use 0 to try to auto-determine\n", - "gain_setting = -1 # gain setting can have value 0 or 1, Default=0.1 for no (None) gain-setting\n", - "integration_time = -1 # integration time, negative values for auto-detection.\n", + "bias_voltage = -1 # detector bias voltage, negative values for auto-detection.\n", + "mem_cells = -1 # number of memory cells used, negative values for auto-detection.\n", + "acq_rate = -1. # the detector acquisition rate, negative values for auto-detection.\n", + "gain_setting = -1 # gain setting can have value 0 or 1, negative values for auto-detection.\n", + "integration_time = -1 # integration time, negative values for auto-detection.\n", "FF_gain = 7.3 # ADU/keV, gain from FF to convert ADU to keV\n", "\n", "fit_hook = False # fit a hook function to medium gain slope --> run without hook\n", @@ -131,7 +131,7 @@ "path_temp = in_folder+\"/r{:04d}/\"\n", "image_name_temp = 'RAW-R{:04d}-AGIPD{:02d}-S{:05d}.h5'\n", "print(\"Parameters are:\")\n", - "if mem_cells == 0.:\n", + "if mem_cells < 0:\n", " print(\"Memory cells: auto-detection on\")\n", "else:\n", " print(\"Memory cells set by user: {}\".format(mem_cells))\n", @@ -189,16 +189,16 @@ " creation_time = creation_time + timedelta(hours=delta_time)\n", "\n", "# Read AGIPD parameter conditions.\n", - "if acq_rate == 0.:\n", + "if acq_rate < 0.:\n", " acq_rate = agipd_cond.get_acq_rate()\n", - "if mem_cells == 0.:\n", + "if mem_cells < 0:\n", " mem_cells = agipd_cond.get_num_cells()\n", "# TODO: look for alternative for passing creation_time\n", - "if gain_setting == -1:\n", + "if gain_setting < 0:\n", " gain_setting = agipd_cond.get_gain_setting(creation_time)\n", - "if bias_voltage == 0.:\n", + "if bias_voltage < 0:\n", " bias_voltage = agipd_cond.get_bias_voltage(karabo_id_control)\n", - "if integration_time == -1:\n", + "if integration_time < 0:\n", " integration_time = agipd_cond.get_integration_time()\n", "\n", "print(f\"Acquisition rate: {acq_rate} MHz\")\n", -- GitLab