nanoq_laser_pulse_channel/tools/sim/graphit.py

23 lines
372 B
Python

# 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()