Debug Dispersion measurement and added first support for XTCAV stabilizer
This commit is contained in:
29
app/xtcavstabilizer.py
Normal file
29
app/xtcavstabilizer.py
Normal file
@ -0,0 +1,29 @@
|
||||
import time
|
||||
import numpy as np
|
||||
|
||||
from bstrd import BSCache
|
||||
|
||||
class XTCAVStabilizer:
|
||||
"""
|
||||
Wrapper class to bundle all daq/io needed for stabilizing the XTCAV
|
||||
"""
|
||||
def __init__(self):
|
||||
self.bs = BSCache(100000,10000) # 100 second timeout, size for 100 second data taken
|
||||
self.channels = ['SATBD02-DBPM040:X2','SATMA02-RLLE-DSP:PHASE-VS']
|
||||
self.bs.get_vars(self.channels) # this starts the stream into the cache
|
||||
self.bs.stop()
|
||||
|
||||
|
||||
def terminate(self):
|
||||
print('Stopping BSStream Thread...')
|
||||
self.bs.stop()
|
||||
self.bs.pt.running.clear() # for some reason I have to
|
||||
|
||||
def flush(self):
|
||||
self.bs.flush()
|
||||
|
||||
def read(self):
|
||||
data=self.bs.__next__()
|
||||
return data['pid'],data[self.channels[0]],data[self.channels[1]] # returns PID, BPM reading, TCAV Phase
|
||||
|
||||
|
Reference in New Issue
Block a user