I working with seismic data using obspy and I want to get a spectrogram for my data. When I apply the spectrogram function to the initial data everything works fine.
st.spectrogram(log=True, title='BW.RJOB ' + str(st[0].stats.starttime))
However when I slice and interpolate the data
tr = st[0]
sr=4.9999
tr2 = tr.slice(point - 20, point + 180)
tr2.interpolate(sampling_rate=sr)
*point is some arbitrary point in my data
*initial sampling rate is 124.99
and then perform the spectrogram
tr2.spectrogram(log=True, title='BW.RJOB ' + str(tr2.stats.starttime))
I get the following error:
*** ValueError: noverlap must be less than n
Why is this happening?