diff --git a/cal_tools/cal_tools/agipdlib.py b/cal_tools/cal_tools/agipdlib.py index 5622e9e65cd3b2dec9ccf77f86732c77a00c93b9..e2eda82b34f38a74ecc8f21d28629fe5a611a49c 100644 --- a/cal_tools/cal_tools/agipdlib.py +++ b/cal_tools/cal_tools/agipdlib.py @@ -25,8 +25,9 @@ def get_num_cells(fname, loc, module): return options[np.argmin(dists)] -def get_acq_rate(slow_paths: Tuple[str, str], - fast_paths: Tuple[str, str, int]) -> Optional[float]: +def get_acq_rate(fast_paths: Tuple[str, str, int], + slow_paths: Optional[Tuple[str, str]] = ('', '') + ) -> Optional[float]: """Get the acquisition rate from said detector module. If the data is available from the middlelayer FPGA_COMP device, then it is diff --git a/notebooks/AGIPD/AGIPD_Correct_and_Verify.ipynb b/notebooks/AGIPD/AGIPD_Correct_and_Verify.ipynb index 5296ecc33fade39c8cf48bda9928f644e4820a4d..e906d9921aa33d3f733bc70e47e11b0cb61f442e 100644 --- a/notebooks/AGIPD/AGIPD_Correct_and_Verify.ipynb +++ b/notebooks/AGIPD/AGIPD_Correct_and_Verify.ipynb @@ -313,7 +313,7 @@ "\n", "# Evaluate aquisition rate\n", "if acq_rate == 0:\n", - " acq_rate = get_acq_rate(('', '') (filename, karabo_id, channel))\n", + " acq_rate = get_acq_rate((filename, karabo_id, channel))\n", "else:\n", " acq_rate = None\n", "\n", diff --git a/notebooks/AGIPD/AGIPD_Retrieve_Constants_Precorrection.ipynb b/notebooks/AGIPD/AGIPD_Retrieve_Constants_Precorrection.ipynb index 99ec430f2501c08a683c02b3415ff3652b14fb6b..8a2ded9840b0484a95478c069917efc61489167d 100644 --- a/notebooks/AGIPD/AGIPD_Retrieve_Constants_Precorrection.ipynb +++ b/notebooks/AGIPD/AGIPD_Retrieve_Constants_Precorrection.ipynb @@ -271,7 +271,7 @@ " break\n", "\n", " if acq_rate == 0.:\n", - " acq_rate = get_acq_rate(('', ''), (f, karabo_id, idx))\n", + " acq_rate = get_acq_rate((f, karabo_id, idx))\n", " else:\n", " acq_rate = None\n", "\n", diff --git a/notebooks/AGIPD/Characterize_AGIPD_Gain_Darks_NBC.ipynb b/notebooks/AGIPD/Characterize_AGIPD_Gain_Darks_NBC.ipynb index 8f377fe52bf2bae3a16640a3dd88cb2a5fe98bbf..49ec24e1dee2e1a6a9bf2a27ed972954aecbf2fa 100644 --- a/notebooks/AGIPD/Characterize_AGIPD_Gain_Darks_NBC.ipynb +++ b/notebooks/AGIPD/Characterize_AGIPD_Gain_Darks_NBC.ipynb @@ -51,8 +51,8 @@ "\n", "mem_cells = 0 # number of memory cells used, set to 0 to automatically infer\n", "bias_voltage = 300 # detector bias voltage\n", - "gain_setting = 0.0 # the gain setting, use 0.1 to try to auto-determine\n", - "acq_rate = 1.1 # the detector acquisition rate, use 0 to try to auto-determine\n", + "gain_setting = 0.1 # the gain setting, use 0.1 to try to auto-determine\n", + "acq_rate = 0. # the detector acquisition rate, use 0 to try to auto-determine\n", "interlaced = False # assume interlaced data format, for data prior to Dec. 2017\n", "rawversion = 2 # RAW file format version\n", "\n", @@ -462,7 +462,7 @@ "max_cells = np.max(all_cells)\n", "print(f\"Using {max_cells} memory cells\")\n", "acq_rate = np.max(all_acq_rate)\n", - "print(f\"Using {acq_rate:0.1f} MHz acquisition rate\")" + "print(f\"Using {acq_rate} MHz acquisition rate\")" ] }, { diff --git a/notebooks/AGIPD/Characterize_AGIPD_Gain_FlatFields_NBC.ipynb b/notebooks/AGIPD/Characterize_AGIPD_Gain_FlatFields_NBC.ipynb index 9775a0772ec61ad65ede00b4b3c18d719b27d18b..6c7a36b8f44b6dfabe902d4f38a5ac7504249481 100644 --- a/notebooks/AGIPD/Characterize_AGIPD_Gain_FlatFields_NBC.ipynb +++ b/notebooks/AGIPD/Characterize_AGIPD_Gain_FlatFields_NBC.ipynb @@ -189,7 +189,7 @@ "channel = 0\n", "fname = fbase.format(runs[0], runs[0].upper(), channel, sequences[0])\n", "if acqrate == 0.:\n", - " acqrate = get_acq_rate(('', ''), (fname, loc, channel))\n", + " acqrate = get_acq_rate((fname, loc, channel))\n", " \n", "\n", "if mem_cells == 0:\n", diff --git a/notebooks/AGIPD/Chracterize_AGIPD_Gain_PC_NBC.ipynb b/notebooks/AGIPD/Chracterize_AGIPD_Gain_PC_NBC.ipynb index 69ca41eb47d3fdccfcc7d782346e32104e4b1373..e137d6ac8c3471f9b4520caa6726248b97a4a9d2 100644 --- a/notebooks/AGIPD/Chracterize_AGIPD_Gain_PC_NBC.ipynb +++ b/notebooks/AGIPD/Chracterize_AGIPD_Gain_PC_NBC.ipynb @@ -159,7 +159,7 @@ " print('Reading ',fname)\n", " \n", " if acq_rate == 0.:\n", - " acq_rate = get_acq_rate(('', ''), (fname, loc, channel))\n", + " acq_rate = get_acq_rate((fname, loc, channel))\n", " print(\"Acquisition rate set from file: {} MHz\".format(acq_rate))\n", "\n", " if mem_cells == 0:\n", diff --git a/notebooks/AGIPD/playground/AGIPD_SingleM_test_Dark.ipynb b/notebooks/AGIPD/playground/AGIPD_SingleM_test_Dark.ipynb index 93b63f2cfede86004ca42f67f6f812c8f4795802..f727a1a94440240014378ad353bb276210798570 100644 --- a/notebooks/AGIPD/playground/AGIPD_SingleM_test_Dark.ipynb +++ b/notebooks/AGIPD/playground/AGIPD_SingleM_test_Dark.ipynb @@ -260,7 +260,7 @@ " cells = get_num_cells(filename, loc, channel)\n", " \n", " if acq_rate == 0.:\n", - " acq_rate = get_acq_rate(('', ''), (filename, loc, channel))\n", + " acq_rate = get_acq_rate((filename, loc, channel))\n", " \n", " thresholds_offset, thresholds_offset_sigma, thresholds_noise, thresholds_noise_sigma = bp_thresh \n", " thresholds_offset_hard = thresholds_offset[gg]\n",