nanoq_laser_pulse_channel/tools/sim/graphit.py

23 lines
372 B
Python
Raw Permalink Normal View History

2024-03-06 21:15:07 +00:00
# take wave_values.txt and plot it
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import sys
matplotlib.use('wxAgg')
f = open('wave_values.txt', 'r')
lines = f.readlines()
f.close()
# convert to float
vals = np.array([float(x) for x in lines])
times = np.arange(0, len(vals), 1)/4096.0
# plot. range is 0 to 1
plt.plot(times, vals)
plt.show()