The construction of the time axis in PyTektronixScope is implemented as self.x_0 + np.arange(self.data_start-1, self.data_stop)*self.delta_x. This approach is correct in principle - x0 is the result of WFMO:XZE? (time coordinate of the first point in the outgoing waveform), data_start and data_stop are determined as DATa:STARt? and DATa:STOP?, and delta_x is the result of WFMO:XIN?, the sampling interval.
When choosing a record length below the maximum record length supported by the scope, this however can lead to an incorrect time axis. The value returned by DATa:STOP? cannot be higher than the maximum record length, but it can be higher than the record length that is currently set. In such a case, when the value of DATa:STOP is between the record length set in the oscilloscope and maximum record length, the returned time axis has more data points than the voltage waveform.
I will suggest a fix.
The construction of the time axis in PyTektronixScope is implemented as
self.x_0 + np.arange(self.data_start-1, self.data_stop)*self.delta_x. This approach is correct in principle -x0is the result ofWFMO:XZE?(time coordinate of the first point in the outgoing waveform),data_startanddata_stopare determined asDATa:STARt?andDATa:STOP?, anddelta_xis the result ofWFMO:XIN?, the sampling interval.When choosing a record length below the maximum record length supported by the scope, this however can lead to an incorrect time axis. The value returned by
DATa:STOP?cannot be higher than the maximum record length, but it can be higher than the record length that is currently set. In such a case, when the value ofDATa:STOPis between the record length set in the oscilloscope and maximum record length, the returned time axis has more data points than the voltage waveform.I will suggest a fix.