From 9c75da4634d4b5f81e322f033eff4bc16b9a3155 Mon Sep 17 00:00:00 2001 From: David Hammer <dhammer@mailbox.org> Date: Mon, 19 Apr 2021 15:16:27 +0200 Subject: [PATCH] New pasha allocation API --- .../AGIPD/Characterize_AGIPD_Gain_Darks_NBC.ipynb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/notebooks/AGIPD/Characterize_AGIPD_Gain_Darks_NBC.ipynb b/notebooks/AGIPD/Characterize_AGIPD_Gain_Darks_NBC.ipynb index fe1a1ae1e..96d7a18a8 100644 --- a/notebooks/AGIPD/Characterize_AGIPD_Gain_Darks_NBC.ipynb +++ b/notebooks/AGIPD/Characterize_AGIPD_Gain_Darks_NBC.ipynb @@ -380,15 +380,15 @@ " ga = np.rollaxis(ga, 2)\n", " ga = np.rollaxis(ga, 2, 1)\n", " \n", - " offset = psh.array((im.shape[0], im.shape[1], num_cells))\n", - " noise = psh.array((im.shape[0], im.shape[1], num_cells))\n", + " offset = psh.alloc(shape=(im.shape[0], im.shape[1], num_cells), dtype=np.float64)\n", + " noise = psh.alloc(like=offset)\n", "\n", " if fixed_gain_mode:\n", " gains = None\n", " gains_std = None\n", " else:\n", - " gains = psh.array((im.shape[0], im.shape[1], num_cells))\n", - " gains_std = psh.array((im.shape[0], im.shape[1], num_cells))\n", + " gains = psh.alloc(like=offset)\n", + " gains_std = psh.alloc(like=offset)\n", "\n", " def process_cell(worker_id, array_index, cell_number):\n", " cell_slice_index = (cellIds == cell_number)\n", @@ -430,7 +430,7 @@ "metadata": {}, "outputs": [], "source": [ - "parallel_num_procs = 4\n", + "parallel_num_procs = 6\n", "parallel_num_threads = multiprocessing.cpu_count() // parallel_num_procs\n", "psh.set_default_context(\"threads\", num_workers=parallel_num_threads)" ] -- GitLab