diff --git a/pyctbgui/pyctbgui/services/Plot.py b/pyctbgui/pyctbgui/services/Plot.py
index 0dfedd205..b172f8102 100644
--- a/pyctbgui/pyctbgui/services/Plot.py
+++ b/pyctbgui/pyctbgui/services/Plot.py
@@ -1,5 +1,6 @@
import logging
from functools import partial
+import pyctbgui.utils.pixelmap as pm
import random
from pathlib import Path
@@ -415,13 +416,26 @@ class PlotTab(QtWidgets.QWidget):
self.mainWindow.read_timer.start(Defines.Time_Plot_Refresh_ms)
def setPixelMap(self):
- if self.view.comboBoxPlot.currentText() == "Matterhorn":
- self.mainWindow.nTransceiverRows = Defines.Matterhorn.nRows
- self.mainWindow.nTransceiverCols = Defines.Matterhorn.nCols
+ if self.view.comboBoxPlot.currentText() == "Matterhorn02":
+ print("Setting pixel map for Matterhorn02")
+ self.mainWindow.nTransceiverRows = Defines.Matterhorn02.nRows
+ self.mainWindow.nTransceiverCols = Defines.Matterhorn02.nCols
+ self.mainWindow.pixel_map = pm.matterhorn_transceiver()
+ elif self.view.comboBoxPlot.currentText() == "Matterhorn1_16bit_1_counter":
+ print("Setting pixel map for Matterhorn1")
+ self.mainWindow.nTransceiverRows = Defines.Matterhorn1.nRows
+ self.mainWindow.nTransceiverCols = Defines.Matterhorn1.nCols
+ 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.nTransceiverCols = Defines.Matterhorn1.nCols
+ self.mainWindow.pixel_map = pm.matterhorn1_transceiver_16bit_4_counters()
elif self.view.comboBoxPlot.currentText() == "Moench04":
self.mainWindow.nAnalogRows = Defines.Moench04.nRows
self.mainWindow.nAnalogCols = Defines.Moench04.nCols
+
def showPatternViewer(self, enable):
if enable:
self.mainWindow.framePatternViewer.show()
diff --git a/pyctbgui/pyctbgui/services/Transceiver.py b/pyctbgui/pyctbgui/services/Transceiver.py
index 98c8fc541..124de5d0b 100644
--- a/pyctbgui/pyctbgui/services/Transceiver.py
+++ b/pyctbgui/pyctbgui/services/Transceiver.py
@@ -133,7 +133,10 @@ class TransceiverTab(QtWidgets.QWidget):
nbitsPerDBit += (8 - (dSamples % 8))
transceiverOffset += nDBitEnabled * (nbitsPerDBit // 8)
trans_array = np.array(np.frombuffer(data, offset=transceiverOffset, dtype=np.uint16))
- return decoder.decode(trans_array, pm.matterhorn_transceiver())
+ print(f'{trans_array.shape=}')
+ tmp = decoder.decode(trans_array, self.mainWindow.pixel_map)
+ print(f'{tmp.shape=}')
+ return tmp
def processImageData(self, data, dSamples):
"""
diff --git a/pyctbgui/pyctbgui/ui/plot.ui b/pyctbgui/pyctbgui/ui/plot.ui
index b01bc3e71..edebb4548 100644
--- a/pyctbgui/pyctbgui/ui/plot.ui
+++ b/pyctbgui/pyctbgui/ui/plot.ui
@@ -165,7 +165,17 @@
-
- Matterhorn
+ Matterhorn02
+
+
+ -
+
+ Matterhorn1_16bit_4_counters
+
+
+ -
+
+ Matterhorn1_16bit_1_counter
-
diff --git a/pyctbgui/pyctbgui/utils/decoder.py b/pyctbgui/pyctbgui/utils/decoder.py
index 6197f811c..ca254b175 100644
--- a/pyctbgui/pyctbgui/utils/decoder.py
+++ b/pyctbgui/pyctbgui/utils/decoder.py
@@ -49,3 +49,4 @@ def matterhorn(trans_buffer):
offset += nSamples
return transceiver_frame
+
diff --git a/pyctbgui/pyctbgui/utils/defines.py b/pyctbgui/pyctbgui/utils/defines.py
index 51c6ac1cb..413285185 100644
--- a/pyctbgui/pyctbgui/utils/defines.py
+++ b/pyctbgui/pyctbgui/utils/defines.py
@@ -50,7 +50,7 @@ class Defines:
Matterhorn = 0
Moench04 = 1
- class Matterhorn:
+ class Matterhorn02:
nRows = 48
nHalfCols = 24
nCols = 48
@@ -58,6 +58,14 @@ class Defines:
tranceiverEnable = 0x3
nPixelsPerTransceiver = 4
+ class Matterhorn1:
+ nRows = 256
+ nHalfCols = 24
+ nCols = 256
+ nTransceivers = 2
+ tranceiverEnable = 0x3
+ nPixelsPerTransceiver = 4
+
class Moench04:
nRows = 400
nCols = 400
diff --git a/pyctbgui/pyctbgui/utils/pixelmap.py b/pyctbgui/pyctbgui/utils/pixelmap.py
index 6cfa28a14..1dd533964 100644
--- a/pyctbgui/pyctbgui/utils/pixelmap.py
+++ b/pyctbgui/pyctbgui/utils/pixelmap.py
@@ -59,3 +59,34 @@ def matterhorn_transceiver():
offset += nSamples
return out
+
+
+def matterhorn1_transceiver_16bit_1_counter():
+ pixel_map = np.zeros((256,256), np.uint32)
+ n_cols = 256
+ n_rows = 256
+ for row in range(n_rows):
+ col = 0
+ for offset in range(0,64,4):
+ for pkg in range(offset,256,64):
+ for pixel in range(4):
+ pixel_map[row, col] = pixel+pkg+row*n_cols
+ col += 1
+
+ return pixel_map
+
+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)
+
+ for row in range(n_rows):
+ for counter in range(n_counters):
+ col = 0
+ for offset in range(0,64,4):
+ for pkg in range(offset,256,64):
+ for pixel in range(4):
+ pixel_map[row+n_rows*counter, col] = pixel+pkg+row*n_cols*n_counters+n_cols*counter
+ col += 1
+ return pixel_map
\ No newline at end of file