From 7ad28503b6857792c51a59641273694775a99e09 Mon Sep 17 00:00:00 2001 From: Philipp Schmidt Date: Wed, 20 Nov 2024 10:17:25 +0100 Subject: [PATCH] Fix pulse slicing code to advance to next train on same pulse ID --- docs/changelog.md | 1 + src/extra/components/_adq.pyx | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/changelog.md b/docs/changelog.md index 647ae57f..6de97b50 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -26,6 +26,7 @@ Fixed: - [`Scan.plot_bin_by_steps()`][extra.components.Scan.plot_bin_by_steps] would previously ignore the `title`/`xlabel`/`ylabel` arguments, now it actually uses them (!237). +- [`AdqRawChannel.pulse_data()`][extra.components.AdqRawChannel.pulse_data] no longer erroneously reads in the same train data for every pulse if there is only a single pulse per train (!259). Changed: - [`gaussian()`][extra.utils.gaussian] has a new `norm` parameter to allow diff --git a/src/extra/components/_adq.pyx b/src/extra/components/_adq.pyx index b1214ec9..ac62c915 100644 --- a/src/extra/components/_adq.pyx +++ b/src/extra/components/_adq.pyx @@ -24,8 +24,8 @@ def _reshape_flat_pulses( for i in range(pulse_ids.shape[0]): cur_pid = pulse_ids[i] - if cur_pid < prev_pid: - # Pulse ID decreasing means a new train started. + if cur_pid <= prev_pid: + # Pulse ID not increasing means a new train started. pid_offset = cur_pid j += 1