May-09-2024, 05:33 PM
(This post was last modified: May-09-2024, 05:33 PM by deanhystad.)
The error message is pretty clear.
Error:ValueError: x and y must have same first dimension, but have shapes (7461,) and (7460,)
The line that raises this error is.plt.plot(t, tr.data)So it looks like t and tr.data are not the same size. That points to this line being wrong.
t = np.arange(0, tr.stats.npts / tr.stats.sampling_rate, tr.stats.delta)I would expect this to be:
t = np.arange(0, tr.stats.npts * tr.stats.delta, tr.stats.delta)Print out the values for tr.stats.delta and tr.stats.sampling_rate. I don't think tr.stats.delta * tr.stats.sampling_rate == 1. The error is in your data, and a bad assumption in your program. Another, less likely possibility is that tr.stats.npts != len(tr.data).