This commit is contained in:
@@ -299,3 +299,46 @@ def get_camera_type(camera_name):
|
||||
return "UNKNOWN"
|
||||
|
||||
|
||||
|
||||
###################################################################################################
|
||||
## BLMs in WS MODE
|
||||
###################################################################################################
|
||||
|
||||
|
||||
def start_blm_ws(blm, duration=10.0):
|
||||
caput(blm+ ":WS_SCAN_DURATION", duration)
|
||||
caput(blm + ":WS_START.PROC", 1)
|
||||
|
||||
def stop_blm_ws(blm):
|
||||
caput(blm + ":WS_STOP.PROC", 1)
|
||||
|
||||
def set_blm_ws_gain(blm, gain):
|
||||
caput(blm + ":WS_PMT_GAIN_VOLTS", 1)
|
||||
|
||||
def get_blm_ws_gain(blm, gain):
|
||||
caget(blm + ":WS_PMT_GAIN_VOLTS")
|
||||
|
||||
|
||||
def set_blm_ws_att(blm, att):
|
||||
caput(blm + ":WS_PMT_ATT_VOLTS", 1)
|
||||
|
||||
def get_blm_ws_att(blm, att):
|
||||
"""
|
||||
string 0: Reference
|
||||
string 1: "2 dB"
|
||||
string 2: 4 dB
|
||||
string 3: 6 dB
|
||||
string 4: 8 dB
|
||||
string 5: 10 dB
|
||||
string 6: 12 dB
|
||||
string 7: 14 dB
|
||||
string 8: 16 dB
|
||||
string 9: 18 dB
|
||||
string 10: 20 dB
|
||||
string 11: 22 dB
|
||||
string 12: 24 dB
|
||||
string 13: 26 dB
|
||||
string 14: 28 dB
|
||||
string 15: 30 dB
|
||||
"""
|
||||
caget(blm + ":WS_PMT_ATT_VOLTS", 'i')
|
||||
|
||||
@@ -69,7 +69,40 @@ class WireScanInfo(DeviceBase):
|
||||
w2y = (pos_motor - self.home_offsets[3]) / (math.sqrt(2))
|
||||
return [w1x, w1y, w2x, w2y]
|
||||
|
||||
|
||||
def is_valid(self):
|
||||
return caget(self.prefix + ":VALID", 'i')==1
|
||||
|
||||
def _get_channel(self, bunch, wire, name):
|
||||
return self.prefix + ":B" + str(int(bunch)) + "_" + wire.upper() + "_" + name
|
||||
|
||||
def set_out_com(self, bunch, wire, value):
|
||||
caput(self._get_channel(bunch, wire, "CENTER_OF_MASS"), float(value))
|
||||
|
||||
def set_out_rms(self, bunch, wire, value):
|
||||
caput(self._get_channel(bunch, wire, "RMS"), float(value))
|
||||
|
||||
def set_out_amp(self, bunch, wire, value):
|
||||
caput(self._get_channel(bunch, wire, "FIT_AMPLITUDE"), float(value))
|
||||
|
||||
def set_out_mean(self, bunch, wire, value):
|
||||
caput(self._get_channel(bunch, wire, "FIT_MEAN"), float(value))
|
||||
|
||||
def set_out_off(self, bunch, wire, value):
|
||||
caput(self._get_channel(bunch, wire, "FIT_OFFSET"), float(value))
|
||||
|
||||
def set_out_sigma(self, bunch, wire, value):
|
||||
caput(self._get_channel(bunch, wire, "FIT_STANDARD_DEVIATION"), float(value))
|
||||
|
||||
def set_out_pos(self, bunch, wire, value):
|
||||
caput(self._get_channel(bunch, wire, "POSITION"), to_array(value, 'd'))
|
||||
|
||||
def set_out_samples(self, bunch, wire, value):
|
||||
caput(self._get_channel(bunch, wire, "AMPLITUDE"), to_array(value, 'd'))
|
||||
|
||||
def set_out_gauss(self, bunch, wire, value):
|
||||
caput(self._get_channel(bunch, wire, "FIT_GAUSS_FUNCTION"), to_array(value, 'd'))
|
||||
|
||||
|
||||
def new_scan_info_device(name, prefix):
|
||||
return WireScanInfo(name, prefix)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user