From b83cb501046317c89ed4f8d5af44a60739bc1933 Mon Sep 17 00:00:00 2001 From: rpartzsch Date: Mon, 22 Jun 2026 17:07:43 +0200 Subject: [PATCH 1/3] fix: rx id mixup in tunings --- tjmonopix2/scans/tune_global_threshold.py | 3 ++- tjmonopix2/scans/tune_local_threshold.py | 2 +- tjmonopix2/system/scan_base.py | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tjmonopix2/scans/tune_global_threshold.py b/tjmonopix2/scans/tune_global_threshold.py index 8b227a8a..c7f1ad62 100644 --- a/tjmonopix2/scans/tune_global_threshold.py +++ b/tjmonopix2/scans/tune_global_threshold.py @@ -70,8 +70,9 @@ def _configure(self, start_column=0, stop_column=512, start_row=0, stop_row=512, self.chip.registers["VH"].write(VCAL_HIGH) self.chip.registers["SEL_PULSE_EXT_CONF"].write(0) + - self.data.hist_occ = oa.OccupancyHistogramming(rx_id=self.chip.chip_id) + self.data.hist_occ = oa.OccupancyHistogramming(rx_id=self.chip.receiver[2]) def _scan(self, n_injections=100, gdac_value_bits=range(6, -1, -1), **_): ''' diff --git a/tjmonopix2/scans/tune_local_threshold.py b/tjmonopix2/scans/tune_local_threshold.py index 677dd8c8..ef24249d 100644 --- a/tjmonopix2/scans/tune_local_threshold.py +++ b/tjmonopix2/scans/tune_local_threshold.py @@ -66,7 +66,7 @@ def _configure(self, start_column=0, stop_column=512, start_row=0, stop_row=512, self.chip.registers["SEL_PULSE_EXT_CONF"].write(0) - self.data.hist_occ = oa.OccupancyHistogramming(rx_id=self.chip.chip_id) + self.data.hist_occ = oa.OccupancyHistogramming(rx_id=self.chip.receiver[2]) def _scan(self, start_column=0, stop_column=512, start_row=0, stop_row=512, n_injections=100, **_): ''' diff --git a/tjmonopix2/system/scan_base.py b/tjmonopix2/system/scan_base.py index b926f8b3..eeba42f2 100644 --- a/tjmonopix2/system/scan_base.py +++ b/tjmonopix2/system/scan_base.py @@ -783,7 +783,7 @@ def write_dict_to_table(dictionary, node): row['attribute'] = attr try: row['value'] = val - except TypeError: # value cannot be implicitly converted to string + except (TypeError, ValueError): # value cannot be implicitly converted to string row['value'] = str(val) row.append() node.flush() From 16d77f6c62221ab19666b9f84662e001f4194535 Mon Sep 17 00:00:00 2001 From: rpartzsch Date: Mon, 22 Jun 2026 17:18:45 +0200 Subject: [PATCH 2/3] fix: parse rx as int for tuning --- tjmonopix2/scans/tune_global_threshold.py | 2 +- tjmonopix2/scans/tune_local_threshold.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tjmonopix2/scans/tune_global_threshold.py b/tjmonopix2/scans/tune_global_threshold.py index c7f1ad62..c1942bfc 100644 --- a/tjmonopix2/scans/tune_global_threshold.py +++ b/tjmonopix2/scans/tune_global_threshold.py @@ -72,7 +72,7 @@ def _configure(self, start_column=0, stop_column=512, start_row=0, stop_row=512, self.chip.registers["SEL_PULSE_EXT_CONF"].write(0) - self.data.hist_occ = oa.OccupancyHistogramming(rx_id=self.chip.receiver[2]) + self.data.hist_occ = oa.OccupancyHistogramming(rx_id=int(self.chip.receiver[2])) def _scan(self, n_injections=100, gdac_value_bits=range(6, -1, -1), **_): ''' diff --git a/tjmonopix2/scans/tune_local_threshold.py b/tjmonopix2/scans/tune_local_threshold.py index ef24249d..369eb0f3 100644 --- a/tjmonopix2/scans/tune_local_threshold.py +++ b/tjmonopix2/scans/tune_local_threshold.py @@ -66,7 +66,7 @@ def _configure(self, start_column=0, stop_column=512, start_row=0, stop_row=512, self.chip.registers["SEL_PULSE_EXT_CONF"].write(0) - self.data.hist_occ = oa.OccupancyHistogramming(rx_id=self.chip.receiver[2]) + self.data.hist_occ = oa.OccupancyHistogramming(rx_id=int(self.chip.receiver[2])) def _scan(self, start_column=0, stop_column=512, start_row=0, stop_row=512, n_injections=100, **_): ''' From 6bfcce2d9006a2ccce6febc668cddfc910bca2bd Mon Sep 17 00:00:00 2001 From: rpartzsch Date: Mon, 22 Jun 2026 17:21:16 +0200 Subject: [PATCH 3/3] fix: empty line in global tuning --- tjmonopix2/scans/tune_global_threshold.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tjmonopix2/scans/tune_global_threshold.py b/tjmonopix2/scans/tune_global_threshold.py index c1942bfc..ea573b9f 100644 --- a/tjmonopix2/scans/tune_global_threshold.py +++ b/tjmonopix2/scans/tune_global_threshold.py @@ -70,7 +70,6 @@ def _configure(self, start_column=0, stop_column=512, start_row=0, stop_row=512, self.chip.registers["VH"].write(VCAL_HIGH) self.chip.registers["SEL_PULSE_EXT_CONF"].write(0) - self.data.hist_occ = oa.OccupancyHistogramming(rx_id=int(self.chip.receiver[2]))