Script execution

This commit is contained in:
sfop
2016-06-06 16:58:38 +02:00
parent 6c89094aa0
commit 6346ed7888

View File

@@ -2,14 +2,13 @@
# S. Bettoni, A. Gobbo, D. Voulot
# 30/05/2016
# Procedure:
# switch off all the magnets between the gun solenoid and the screen or BPM used for the measurement
# change the current of the gun soleoid
# look at the centroid position (BPM or screen) downstream of the gun.
I_set = Channel("SINEG01-MSOL130:I-SET")
I_read = Channel("SINEG01-MSOL130:I-READ")
I_get = Channel("SINEG01-MSOL130:I-READ")
# cam_x, cam_y = ... # some camtool command / channel?
bpm_x = ai1 # Channel("SINEG01-DBPM340:X1")
bpm_y = ai2 # Channel("SINEG01-DBPM340:Y1")
@@ -19,29 +18,26 @@ def ccr(mag):
while n > 0:
sleep(0.5)
n = caget(mag + ":I-COMP")
def laser_on():
caput("SIN-CVME-TIMAST-TMA:LaserDelayControl", 0)
def laser_off():
caput("SIN-CVME-TIMAST-TMA:LaserDelayControl", 1)
I1 = 2.0
I2 = 5.0
dI = 0.5
# Switch off magnets
mag = [ "SINEG01-MCRX120",
"SINEG01-MCRY120"]
mag = ["SINEG01-MCRX120","SINEG01-MCRY120"]
for m in mag:
caput(m + ":I-SET", 0.0)
for m in mag:
ccr(m)
# Disable laser delay
#caput("SIN-CVME-TIMAST-TMA:LaserDelayControl", 0)
# Scan using the screen
#r = lscan(I_set, [I_read, cam_x, cam_y], I1, I2, dI, passes = 2, zigzag = True)
#r = lscan(I_set, [I_get, cam_x, cam_y], I1, I2, dI, passes = 2, zigzag = True)
# Scan using the BPM
r = lscan(I_set, [I_read, bpm_x, bpm_y], I1, I2, dI, 1.0)
# Enable laser delay
#caput("SIN-CVME-TIMAST-TMA:LaserDelayControl", 1)
r = lscan(I_set, [I_get, bpm_x, bpm_y], I1, I2, dI, 1.0, before_read = laser_on(), after_read = laser_off())
# take the result of the scan and do the plots
plot(r.getReadable(2), xdata=r.getReadable(1), title = "Centroid excursion")