Skip to content
Snippets Groups Projects
Commit 053f5e8c authored by Sander de Snoo's avatar Sander de Snoo
Browse files

Fix mixed measurement assignments and raw measurements in measurement processing

parent 87ee8bd0
No related branches found
Tags v1.6.18
No related merge requests found
# Changelog
All notable changes to Pulselib will be documented in this file.
## \[1.7.6] - 2023-10-17
- Fix mixed measurement assignments and raw measurements in measurement processing.
## \[1.7.5] - 2023-10-13
- Fixed looping of keyword arguments. (It was broken by the performance update of v1.7)
......
......@@ -363,19 +363,21 @@ class MeasurementConverter:
last_result = {}
n_rep = self.n_rep if self.n_rep else 1
accepted_mask = np.ones(n_rep, dtype=int)
for i, m in enumerate(self._description.measurements):
acquisition_cnt = 0
for m in self._description.measurements:
if isinstance(m, measurement_acquisition):
if not m.has_threshold:
# do not add to result
continue
result = self._raw[i] > m.threshold
result = self._raw[acquisition_cnt] > m.threshold
if m.zero_on_high:
result = result ^ 1
result = result.astype(int)
hw_thresholded = self._hw_thresholded.get(i, None)
hw_thresholded = self._hw_thresholded.get(acquisition_cnt, None)
if hw_thresholded is not None and np.any(result != hw_thresholded):
logger.warning(f'{np.sum(result != hw_thresholded)} differences between hardware and software '
f'threshold. (indices: {np.where(result != hw_thresholded)})')
acquisition_cnt += 1
elif isinstance(m, measurement_expression):
result = m.expression.evaluate(last_result)
else:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment