Script execution

This commit is contained in:
sfop
2016-06-14 16:00:18 +02:00
parent 2adc6d9450
commit c4493670be

View File

@@ -9,7 +9,7 @@
# 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 = Channel("SINEG01-DBPM340:X1")
bpm_y = Channel("SINEG01-DBPM340:Y1")
@@ -23,9 +23,10 @@ def ccr(mag):
sleep(0.5)
n = caget(mag + ":I-COMP")
def laser_on():
caput("SIN-CVME-TIMAST-TMA:LaserDelayControl", 0)
caput("SIN-TIMAST-TMA:Beam-Las-Delay-Sel", 0)
def laser_off():
caput("SIN-CVME-TIMAST-TMA:LaserDelayControl", 1)
caput("SIN-TIMAST-TMA:Beam-Las-Delay-Sel", 1)
I1 = 20.0
I2 = 150.0
@@ -46,10 +47,15 @@ for m in mag:
for m in mag:
ccr(m)
laser_on()
# Scan using the screen
#r = lscan(I_set, [I_read, cam_x, cam_y], I1, I2, dI, 1.0, passes = 2, zigzag = True)
# Scan using the BPM
r = lscan(I_set, [I_get, cam_x, cam_y], I1, I2, dI, 1.0, before_read = laser_on, after_read = laser_off)
try:
#r = lscan(I_set, [I_get, cam_x, cam_y], I1, I2, dI, 1.0, before_read = ccr)
r = lscan(I_set, [I_get, cam_x, cam_y], I1, I2, dI, 1.0)
finally:
laser_off()
# take the result of the scan and do the plots
plot(r.getReadable(2), xdata=r.getReadable(1), title = "Centroid excursion")