From e475d887a0c1dbe2e5713ca68b7389a388971ff4 Mon Sep 17 00:00:00 2001 From: sfop Date: Tue, 21 Jun 2016 10:07:57 +0200 Subject: [PATCH] Script execution --- script/Alignment/Gun_solenoid_alignment.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/script/Alignment/Gun_solenoid_alignment.py b/script/Alignment/Gun_solenoid_alignment.py index ab66a47..d1c969e 100755 --- a/script/Alignment/Gun_solenoid_alignment.py +++ b/script/Alignment/Gun_solenoid_alignment.py @@ -12,7 +12,7 @@ import org.apache.commons.math3.linear.Array2DRowRealMatrix as Matrix import ch.psi.utils.Convert.toBidimensional as mono_to_bidi - + I_set = Channel("SINEG01-MSOL130:I-SET", alias = "I_set"); I_get = Channel("SINEG01-MSOL130:I-READ", alias = "I_get") @@ -51,6 +51,7 @@ def ccr(mag): while n > 0: sleep(0.5) n = caget(mag + ":I-COMP") + def laser_on(): caput("SIN-TIMAST-TMA:Beam-Las-Delay-Sel", 0) @@ -72,11 +73,10 @@ def run_pipeline(): I1 = 20.0 I2 = 30.0 dI = 1.0 -settling_time = 1.0 +settling_time = 0.0 # Switch off magnets mag = [ "SINEG01-MCRX120","SINEG01-MCRY120", - "SINEG01-MSOL130", "SINEG01-MQUA140", "SINEG01-MQUA150", "SINEG01-MCRX160","SINEG01-MCRY160", @@ -90,13 +90,19 @@ for m in mag: for m in mag: ccr(m) +def br(): + ccr("SINEG01-MSOL130") + +def ar(): + pass + 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 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, cam_img], I1, I2, dI, settling_time) + r = lscan(I_set, [I_get, cam_x, cam_y, cam_img], I1, I2, dI, settling_time, before_read = br, after_read = ar) finally: laser_off()