diff --git a/notebooks/AGIPD/CS_Characterization_unequalClockStep_NBC.ipynb b/notebooks/AGIPD/CS_Characterization_unequalClockStep_NBC.ipynb index 43449eb071543fbd64234d9fe5586ac7c41cfa5d..0b3bf01665879f6f5a62f84eec8e37d4ffc212a5 100644 --- a/notebooks/AGIPD/CS_Characterization_unequalClockStep_NBC.ipynb +++ b/notebooks/AGIPD/CS_Characterization_unequalClockStep_NBC.ipynb @@ -1573,7 +1573,7 @@ " gain_setting=gain_setting,\n", " integration_time=integration_time)\n", "\n", - " db_modules = get_pdu_from_db(karabo_id, karabo_da, Constants.AGIPD.SlopesPC(),\n", + " db_modules = get_pdu_from_db(karabo_id, karabo_da, Constants.AGIPD.SlopesCS(),\n", " condition, cal_db_interface,\n", " snapshot_at=creation_time)\n", "\n", diff --git a/notebooks/AGIPD/CS_parallelMerging_NBC.ipynb b/notebooks/AGIPD/CS_parallelMerging_NBC.ipynb index 66942281c04b5dada917d2ca65ba0ed65e13dd39..de8cbacca431253815bf5f97ffb21f914d478fd0 100644 --- a/notebooks/AGIPD/CS_parallelMerging_NBC.ipynb +++ b/notebooks/AGIPD/CS_parallelMerging_NBC.ipynb @@ -26,7 +26,7 @@ "runs2 = [-1] # list of runs to use, ITESTC 80, use -1 for auto-completion\n", "runs3 = [-1] # list of runs to use, ITESTC 120, use -1 for auto-completion\n", "runs4 = [-1] # list of runs to use, ITESTC 170, use -1 for auto-completion\n", - "modules = [3] # modules to work on, required, range allowed\n", + "modules = [8] # modules to work on, required, range allowed\n", "\n", "karabo_da = [\"all\"]\n", "karabo_id_control = \"SPB_IRU_AGIPD1M1\" # karabo-id for the control device e.g. \"MID_EXP_AGIPD1M1\", or \"SPB_IRU_AGIPD1M1\"\n", @@ -82,7 +82,6 @@ "\n", "from collections import OrderedDict\n", "import xarray\n", - "\n", "import matplotlib.pyplot as plt\n", "\n", "from extra_data import RunDirectory\n", @@ -90,12 +89,7 @@ "from concurrent.futures import ProcessPoolExecutor\n", "\n", "from cal_tools.agipdlib import AgipdCtrl\n", - "from cal_tools.tools import (\n", - " get_dir_creation_date, \n", - " get_report, \n", - " calcat_creation_time\n", - ")\n", - "\n", + "from cal_tools.tools import calcat_creation_time\n", "from cal_tools.step_timing import StepTimer\n", "\n", "%matplotlib inline" @@ -107,8 +101,6 @@ "metadata": {}, "outputs": [], "source": [ - "cells = mem_cells\n", - "\n", "print(\"Parameters are:\")\n", "if mem_cells == -1.:\n", " print(\"Memory cells: auto-detection on\")\n", @@ -211,8 +203,6 @@ " cells = r.detector_info(instrument_source)['frames_per_train']\n", " bursts = total_frame // cells\n", "\n", - "# del c\n", - "\n", " return bursts\n", "\n", "trains = []\n", @@ -245,8 +235,8 @@ "\n", " instrument_source = karabo_id+'/DET/{}CH0:xtdf'.format(channel) \n", "\n", - " d = r.get_array(instrument_source, 'image.data')[:trains*cells, 0, :, :]\n", - " d = d.values.reshape((d.shape[0] // cells, cells, 1, 512, 128))\n", + " d = r.get_array(instrument_source, 'image.data')[:trains*mem_cells, 0, :, :]\n", + " d = d.values.reshape((d.shape[0] // mem_cells, mem_cells, 1, 512, 128))\n", " d = np.moveaxis(d, 4, 3).astype(np.float32)\n", "\n", " \n", @@ -271,8 +261,7 @@ " else:\n", " ASIC_code.append(1)\n", " print(f\"Signal rise ok ({rise_val})\")\n", - " \n", - "# del d\n", + "\n", " return ASIC_code\n", "\n", "\n", @@ -392,7 +381,6 @@ " else:\n", " for i in range(counter, 64, 4):\n", " cs_data['analog'][..., index[1][0]:index[1][1], index[0][0]+i] = d[:, :, 0, :, i]\n", - " del d\n", " \n", " context.map(fill_ASIC, range(0,16))\n", " \n", @@ -426,7 +414,6 @@ " cs_data = process_module(module, runs_dict_list, cell_id) #cs_data[0] - channel, cs_data[1] - analog, cs_data[2] digital\n", " dset[:, cell_id[0]:cell_id[1], ...] = cs_data[1]\n", " f.flush()\n", - " del cs_data\n", " \n", " end = datetime.now() - start\n", " print(f'Duration of merging for module {channel}: ', end)" @@ -458,7 +445,7 @@ "metadata": {}, "outputs": [], "source": [ - "mc = 300\n", + "mc = 4\n", "burst_of_interest = [10, 300, -50]\n", "im_ratio = cs_data[0][0, 0, ...].shape[1] / cs_data[0][0, 0, ...].shape[0]\n", "vmin = 0.9*np.mean(cs_data[0][mc, ...])\n", @@ -549,15 +536,6 @@ " ax.set_xticks([])\n", " ax.grid()" ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "#report = get_report(metadata_folder)" - ] } ], "metadata": {