From 8a0191e3f6c40e8ad0948b9c98cea32a865d3382 Mon Sep 17 00:00:00 2001 From: froejdh_e Date: Wed, 28 Jan 2026 15:54:27 +0100 Subject: [PATCH] using np.take and updated pixel map --- pyctbgui/pyctbgui/services/Plot.py | 2 +- pyctbgui/pyctbgui/services/Transceiver.py | 3 ++- pyctbgui/pyctbgui/utils/pixelmap.py | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pyctbgui/pyctbgui/services/Plot.py b/pyctbgui/pyctbgui/services/Plot.py index b172f8102..318a00317 100644 --- a/pyctbgui/pyctbgui/services/Plot.py +++ b/pyctbgui/pyctbgui/services/Plot.py @@ -428,7 +428,7 @@ class PlotTab(QtWidgets.QWidget): self.mainWindow.pixel_map = pm.matterhorn1_transceiver_16bit_1_counter() elif self.view.comboBoxPlot.currentText() == "Matterhorn1_16bit_4_counters": print("Setting pixel map for Matterhorn1 with 4 counters") - self.mainWindow.nTransceiverRows = Defines.Matterhorn1.nRows + self.mainWindow.nTransceiverRows = Defines.Matterhorn1.nRows*4 self.mainWindow.nTransceiverCols = Defines.Matterhorn1.nCols self.mainWindow.pixel_map = pm.matterhorn1_transceiver_16bit_4_counters() elif self.view.comboBoxPlot.currentText() == "Moench04": diff --git a/pyctbgui/pyctbgui/services/Transceiver.py b/pyctbgui/pyctbgui/services/Transceiver.py index 124de5d0b..e478587f5 100644 --- a/pyctbgui/pyctbgui/services/Transceiver.py +++ b/pyctbgui/pyctbgui/services/Transceiver.py @@ -134,7 +134,8 @@ class TransceiverTab(QtWidgets.QWidget): transceiverOffset += nDBitEnabled * (nbitsPerDBit // 8) trans_array = np.array(np.frombuffer(data, offset=transceiverOffset, dtype=np.uint16)) print(f'{trans_array.shape=}') - tmp = decoder.decode(trans_array, self.mainWindow.pixel_map) + # tmp = decoder.decode(trans_array, self.mainWindow.pixel_map) + tmp = np.take(trans_array, self.mainWindow.pixel_map) print(f'{tmp.shape=}') return tmp diff --git a/pyctbgui/pyctbgui/utils/pixelmap.py b/pyctbgui/pyctbgui/utils/pixelmap.py index 1dd533964..72fbcc385 100644 --- a/pyctbgui/pyctbgui/utils/pixelmap.py +++ b/pyctbgui/pyctbgui/utils/pixelmap.py @@ -79,7 +79,7 @@ def matterhorn1_transceiver_16bit_4_counters(): n_counters = 4 n_cols = 256 n_rows = 256 - pixel_map = np.zeros((n_rows*n_counters,n_cols,n_counters), np.uint32) + pixel_map = np.zeros((n_rows*n_counters,n_cols), np.uint32) for row in range(n_rows): for counter in range(n_counters):