Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions labscript_devices/NI_DAQmx/blacs_workers.py
Original file line number Diff line number Diff line change
Expand Up @@ -627,10 +627,16 @@ def extract_measurements(self, raw_data, waits_in_use):
# We want np.floor(x) to yield the largest integer < x (not <=):
if t_end - t0 - i_end / self.buffered_rate < 2e-16:
i_end -= 1
# IBS: we sometimes find that t_end (with waits) gives a time
# after the end of acquisition. The following line
# will produce return a shorter than expected array if i_end
# is larger than the length of the array.
values = raw_data[connection][i_start : i_end + 1]
i_end = i_start + len(values) - 1 # re-measure i_end

t_i = t0 + i_start / self.buffered_rate
t_f = t0 + i_end / self.buffered_rate
times = np.linspace(t_i, t_f, i_end - i_start + 1, endpoint=True)
values = raw_data[connection][i_start : i_end + 1]
times = np.linspace(t_i, t_f, len(values), endpoint=True)
dtypes = [('t', np.float64), ('values', np.float32)]
data = np.empty(len(values), dtype=dtypes)
data['t'] = times
Expand Down