From c4493670be475764d338f6f65a00fefe7a215bb8 Mon Sep 17 00:00:00 2001 From: sfop Date: Tue, 14 Jun 2016 16:00:18 +0200 Subject: [PATCH] Script execution --- script/Alignment/Gun_solenoid_alignment_dv.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/script/Alignment/Gun_solenoid_alignment_dv.py b/script/Alignment/Gun_solenoid_alignment_dv.py index 98ea3d8..b9cc7e8 100644 --- a/script/Alignment/Gun_solenoid_alignment_dv.py +++ b/script/Alignment/Gun_solenoid_alignment_dv.py @@ -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")