Improvements to debug scripts

This commit is contained in:
Thomas Kolb 2024-03-30 22:04:26 +01:00
parent d9707ac4a9
commit 66c88bf889
2 changed files with 6 additions and 3 deletions

View File

@ -17,7 +17,7 @@ with open(sys.argv[1], 'rb') as infile:
t = np.arange(0, T*data.size, T)
amp = np.absolute(data)
phase = np.angle(data)
phase = np.unwrap(np.angle(data))
pp.plot(t, amp, 'r-')
pp.legend(['Amplitude'])

View File

@ -35,8 +35,11 @@ ax.legend(['Spectrum'])
ax.set_xlabel('Frequency [Hz]')
def update(*args):
spec, f = load_data()
line.set_ydata(spec)
try:
spec, f = load_data()
line.set_ydata(spec)
except Exception as e:
print(e)
return [line]