diff --git a/notebooks/LPDMini/LPD_Mini_Char_Darks_NBC.ipynb b/notebooks/LPDMini/LPD_Mini_Char_Darks_NBC.ipynb index d5de306fe592864502211f6d47b8bbf641962b9b..122e7579b117a22ed4e85efe4bf6870d61fee18a 100644 --- a/notebooks/LPDMini/LPD_Mini_Char_Darks_NBC.ipynb +++ b/notebooks/LPDMini/LPD_Mini_Char_Darks_NBC.ipynb @@ -163,7 +163,7 @@ "pdu_name_by_da = {da: p['physical_name'] for (da, p) in pdus_by_da.items()}\n", "\n", "# Override:\n", - "pdu_name_by_da = {'LPDMINI00/1': 'LPD_TEST_FAKE_MINI01', 'LPDMINI00/7': 'LPD_TEST_FAKE_MINI02'}\n", + "#pdu_name_by_da = {'LPDMINI00/1': 'LPD_TEST_FAKE_MINI01', 'LPDMINI00/7': 'LPD_TEST_FAKE_MINI02'}\n", "\n", "if karabo_da and '/' in karabo_da[0]:\n", " pdu_name_by_da = {da: pdu_name_by_da[da] for da in karabo_da}\n", @@ -173,6 +173,16 @@ "modules = [int(x.split('/')[-1]) for x in karabo_da]" ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "for da, pdu in pdu_name_by_da.items():\n", + " print(f\"{da} -> {pdu}\")" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -293,9 +303,8 @@ " print(\"Process run: \", run_path)\n", " inp.append((run_path, gain_i))\n", "\n", - "# with multiprocessing.Pool(processes=parallel_num_procs) as pool:\n", - "# results = pool.starmap(characterize_module, inp)\n", - "results = [characterize_module(*i) for i in inp]\n", + "with multiprocessing.Pool(processes=parallel_num_procs) as pool:\n", + " results = pool.starmap(characterize_module, inp)\n", "\n", "for ir, r in enumerate(results):\n", " offset, noise, gg, bp, data, normal, cellid_pattern = r\n", @@ -377,7 +386,7 @@ " for const in clist:\n", " constant = getattr(Constants.LPD, const)()\n", "\n", - " data, mdata = get_from_db(karabo_id, karabo_da,\n", + " data, mdata = get_from_db(karabo_id, karabo_da_m,\n", " constant,\n", " condition, None,\n", " cal_db_interface,\n", diff --git a/notebooks/LPDMini/LPD_Mini_Correct.ipynb b/notebooks/LPDMini/LPD_Mini_Correct.ipynb index 3ea558e4db1101e9a83254bf09aeb9b63f4e16bc..b141f27881d4f145a24dfe53cce0a1c5bf0647f1 100644 --- a/notebooks/LPDMini/LPD_Mini_Correct.ipynb +++ b/notebooks/LPDMini/LPD_Mini_Correct.ipynb @@ -333,11 +333,11 @@ "\n", "const_shape = (mem_cells, 32 * len(module_nums), 256, 3) # cells, slow_scan, fast_scan, gain\n", "const_slices = [slice(i * 32, (i+1) * 32) for i in range(len(module_nums))]\n", - "raw_data_slices = [slice((n-1) * 32, n * 32) for n in module_nums]\n", + "raw_data_slices = [slice(n * 32, (n+1) * 32) for n in module_nums]\n", "\n", "def _assemble_constant(arr, calibration_name):\n", " for mod_num, sl in zip(module_nums, const_slices):\n", - " arr[:, sl] = const_data[mod_num, calibration_name]\n", + " arr[:, sl] = const_data[mod_num, calibration_name]['data']\n", "\n", "offset_const = np.zeros(const_shape, dtype=np.float32)\n", "if offset_corr:\n", @@ -385,6 +385,8 @@ " # mangling the frame axis for an actual frame count of 1.\n", " start = perf_counter()\n", " in_raw = inp_source['image.data'].ndarray()\n", + " if in_raw.ndim > 3:\n", + " in_raw = in_raw[:, 0]\n", " in_cell = inp_source['image.cellId'].ndarray().reshape(-1)\n", " in_pulse = inp_source['image.pulseId'].ndarray().reshape(-1)\n", " read_time = perf_counter() - start\n",