Script execution
This commit is contained in:
@@ -10,16 +10,15 @@
|
||||
|
||||
I_set = Channel("SINEG01-MSOL130:I-SET")
|
||||
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 ccr(channel):
|
||||
def ccr(mag):
|
||||
n = 1
|
||||
while n > 0:
|
||||
sleep(0.2)
|
||||
n = caget(channel)
|
||||
sleep(0.5)
|
||||
n = caget(mag + ":I-COMP")
|
||||
|
||||
I1 = 20.0
|
||||
I2 = 150.0
|
||||
@@ -41,27 +40,25 @@ mag = [ "SINEG01-MCRX120",
|
||||
"SINEG01-MQUA310",
|
||||
"SINEG01-MQUA320" ]
|
||||
for m in mag:
|
||||
channel = m + ":I-SET"
|
||||
caput(channel, 0.0)
|
||||
caput(m + ":I-SET", 0.0)
|
||||
for m in mag:
|
||||
channel = m + ":I-COMP"
|
||||
ccr(channel)
|
||||
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, before_read = CheckCurrent)
|
||||
#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_read, bpm_x, bpm_y], I1, I2, dI, passes = 2, zigzag = True, before_read = ccr(I_comp))
|
||||
r = lscan(I_set, [I_read, bpm_x, bpm_y], I1, I2, dI, 1.0, passes = 2, zigzag = True)
|
||||
|
||||
# Enable laser delay
|
||||
caput("SIN-CVME-TIMAST-TMA:LaserDelayControl", 1)
|
||||
|
||||
# take the result of the scan and do the plots
|
||||
x = r.getReadable(1)
|
||||
y = r.getReadable(2)
|
||||
plot(y, xdata=x, title = "CM")
|
||||
centroid_x = r.getReadable(1)
|
||||
centroid_y = r.getReadable(2)
|
||||
plot(centroid_y, xdata=centroid_x, title = "Centroid excursion")
|
||||
|
||||
# save the entry in the logbook
|
||||
msg = str(r)
|
||||
|
||||
Reference in New Issue
Block a user