diff --git a/ADwinProII/ADwin_utils.py b/ADwinProII/ADwin_utils.py index 3ac371ebdba10f36f39344e18adb44fca772e7e1..33f12841b4bf3c3d4760fd8ebf22f19cbda4d931 100644 --- a/ADwinProII/ADwin_utils.py +++ b/ADwinProII/ADwin_utils.py @@ -206,5 +206,10 @@ def get_aout_trace(h5file, output): data = f["devices/ADwin/ANALOG_OUT/VALUES"][:] mask = (data["channel"] == port) t = np.round(PROCESSDELAY / CLOCK_T12 * data["n_cycles"][mask], 9) + if "data" in f and "waits" in f["data"]: + # There was a wait in the experiment, let's offset the times such that they are accurate + waits = f["data/waits"][:] + for i in range(len(waits)): + t[t > waits["time"][i]] += waits["duration"][i] values = DAC(data["value"][mask]) return t, values \ No newline at end of file