60 lines
1.3 KiB
Python
Executable File
60 lines
1.3 KiB
Python
Executable File
#!/usr/bin/env python
|
|
|
|
from time import sleep
|
|
from collections import deque
|
|
import numpy as np
|
|
import scipy.signal
|
|
|
|
from zoetrope import aniplot as plt
|
|
from scipy.stats.stats import pearsonr
|
|
from bstrd import BS, bsstream
|
|
plt.blit = False
|
|
plt.style.use('ggplot')
|
|
|
|
chname_x1 = "SLAAR-LADC-WL001:ADCX_VAL"
|
|
chname_x2 = "SLAAR-LADC-WL002:ADCX_VAL"
|
|
chname_i0 = "SLAAR-LADC-WL003:ADCI_VAL"
|
|
|
|
# create channel
|
|
ch_x1 = BS(chname_x1)
|
|
ch_x2 = BS(chname_x2)
|
|
#ch_i0 = BS(chname_i0)
|
|
|
|
n = 100
|
|
sigs1 = np.empty(n)
|
|
sigs2 = np.empty(n)
|
|
#i0s = np.empty(n)
|
|
|
|
# create the empty plot
|
|
pd = plt.plot([0])
|
|
|
|
# some plot settings
|
|
#plt.suptitle("{}, {}".format(chname_diode1, chname_diode2))
|
|
plt.fig.set_figheight(5)
|
|
plt.fig.set_figwidth(5)
|
|
plt.tight_layout()
|
|
|
|
for counter, data in zip(plt.show(), bsstream):
|
|
print(counter)
|
|
|
|
for i in range(n):
|
|
sigs1[i] = ch_x1.get()
|
|
sigs2[i] = ch_x2.get()
|
|
#i0s[i] = ch_i0.get()
|
|
next(bsstream) # this gets the next set of data
|
|
|
|
|
|
#xs = np.arange(len(pp_sigs))
|
|
plt.clf()
|
|
#plt.plot(sigs1)
|
|
plt.scatter(sigs1, sigs2)
|
|
#plt.title("{}, ch1:{}, ch2:{}".format(chname_i0.split(':')[0].split('-')[-1], round(pearscoeff1, 4), round(pearscoeff2, 4)))
|
|
#plt.legend(loc='best')
|
|
plt.show()
|
|
|
|
# this, I need to move into the library
|
|
pd.ax.relim()
|
|
pd.ax.autoscale_view()
|
|
|
|
bsstream.close()
|