This commit is contained in:
2016-06-06 14:03:44 +02:00
parent d2f060b6b6
commit 1b64ab8f28

View File

@@ -9,38 +9,51 @@
# look at the centroid position (BPM or screen) downstream of the gun.
I_set = Channel("SINEG01-MSOL130:I-SET")
I = Channel("SINEG01-MSOL130:I-READ")
cam_x, cam_y = ... # some camtool command / channel?
I_read = Channel("SINEG01-MSOL130:I-READ")
I_comp = Channel("SINEG01-MSOL130:I-COMP")
# cam_x, cam_y = ... # some camtool command / channel?
bpm_x = Channel("SINEG01-DBPM340:X1")
bpm_y = Channel("SINEG01-DBPM340:Y1")
def CheckCurrent():
def ccr(channel):
n = 1
while n > 0:
sleep(0.2)
n = caget("SINEG01-MSOL130:I-COMP")
n = caget(channel)
I1 = 20.0
I2 = 150.0
dI = 1.0
# Switch off magnets
caput("SINEG01-MCRX120:I-SET", 0.0)
caput("SINEG01-MCRY120:I-SET", 0.0)
caput("SINEG01-MQUA140:I-SET", 0.0)
caput("SINEG01-MQUA150:I-SET", 0.0)
caput("SINEG01-MCRX160:I-SET", 0.0)
caput("SINEG01-MCRY160:I-SET", 0.0)
caput("SINEG01-MCRX180:I-SET", 0.0)
caput("SINEG01-MCRY180:I-SET", 0.0)
mag = [ "SINEG01-MCRX120",
"SINEG01-MCRY120",
"SINEG01-MQUA140",
"SINEG01-MQUA150",
"SINEG01-MCRX160",
"SINEG01-MCRY160",
"SINEG01-MCRX180",
"SINEG01-MCRY180",
"SINEG01-MCRX200",
"SINEG01-MCRY200",
"SINEG01-MCRX220",
"SINEG01-MCRY220",
"SINEG01-MQUA310",
"SINEG01-MQUA320" ]
for m in mag:
channel = m + ":I-SET"
caput(channel, 0.0)
for m in mag:
channel = m + ":I-COMP"
ccr(channel)
# Disable laser delay
caput("SIN-CVME-TIMAST-TMA:LaserDelayControl", 0)
# Scan using the screen
#r = lscan(I_set, [I, cam_x, cam_y], I1, I2, dI, passes = 2, zigzag = True, before_read = CheckCurrent)
#r = lscan(I_set, [I_read, cam_x, cam_y], I1, I2, dI, passes = 2, zigzag = True, before_read = CheckCurrent)
# Scan using the BPM
r = lscan(I_set, [I, bpm_x, bpm_y], I1, I2, dI, passes = 2, zigzag = True, before_read = CheckCurrent)
r = lscan(I_set, [I_read, bpm_x, bpm_y], I1, I2, dI, passes = 2, zigzag = True, before_read = ccr(I_comp))
# Enable laser delay
caput("SIN-CVME-TIMAST-TMA:LaserDelayControl", 1)