48 lines
906 B
Python
Executable File
48 lines
906 B
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 bstrd import BS, bsstream
|
|
plt.blit = False
|
|
|
|
# config
|
|
diode_PV = "SLAAR11-LSCP1-FNS:CH4:VAL_GET"
|
|
events_PV = "SAR-CVME-TIFALL4:EvtSet"
|
|
length = 1000
|
|
|
|
# create channel
|
|
diode = BS(diode_PV)
|
|
events = BS(events_PV)
|
|
|
|
# create a buffer for the plotting
|
|
values = deque(maxlen=length)
|
|
|
|
# create the empty plot
|
|
pd = plt.plot([0])
|
|
|
|
# some plot settings
|
|
plt.suptitle(diode_PV)
|
|
#plt.fig.set_figheight(12)
|
|
#plt.fig.set_figwidth(9)
|
|
plt.tight_layout()
|
|
|
|
for counter, data in zip(plt.show(), bsstream):
|
|
print(counter)
|
|
|
|
pp_sig = diode.get()
|
|
evt_codes = events.get()
|
|
values.append(pp_sig)
|
|
|
|
xs = np.arange(len(values))
|
|
pd.set(xs, values)
|
|
|
|
# this, I need to move into the library
|
|
pd.ax.relim()
|
|
pd.ax.autoscale_view()
|
|
|
|
bsstream.close()
|