From 485905c8f86e6185e5e795ca7582ae2f67266db2 Mon Sep 17 00:00:00 2001 From: sfop Date: Wed, 15 Jun 2016 14:50:29 +0200 Subject: [PATCH] Script execution --- script/Alignment/Gun_solenoid_alignment.py | 34 +++++++--------------- 1 file changed, 10 insertions(+), 24 deletions(-) diff --git a/script/Alignment/Gun_solenoid_alignment.py b/script/Alignment/Gun_solenoid_alignment.py index 8b98351..b2f6010 100755 --- a/script/Alignment/Gun_solenoid_alignment.py +++ b/script/Alignment/Gun_solenoid_alignment.py @@ -32,21 +32,8 @@ cam_raw_data = Channel("SINEG01-DSCR190:data") class CameraImage(ReadableMatrix): def read(self): raw = cam_raw_data.read() - return mono_to_bidi(raw, self.getWidth(), self.getHeight()) - - def getWidth(self): - return 480 - - def getHeight(self): - return 640 - - -class CameraImage(ReadableMatrix): - def read(self): - raw = cam_raw_data.read() - if self.transposed: - return Matrix(mono_to_bidi(raw, self.getHeight(), self.getWidth())).transpose().getData() - return mono_to_bidi(raw, self.getWidth(), self.getHeight()) + return Matrix(mono_to_bidi(raw, self.getHeight(), self.getWidth())).transpose().getData() #data is transposed + #return mono_to_bidi(raw, self.getWidth(), self.getHeight()) def getWidth(self): return self._width @@ -55,8 +42,7 @@ class CameraImage(ReadableMatrix): return self._height -cam_img = CameraImage() -cam_img.transposed = True +cam_img = CameraImage() cam_img._width = len(profile_x.read()) cam_img._height = len(profile_y.read()) @@ -87,7 +73,7 @@ def run_pipeline(): I1 = 20.0 I2 = 150.0 dI = 1.0 -settling_time = 0.0 +settling_time = 1.0 # Switch off magnets mag = [ "SINEG01-MCRX120","SINEG01-MCRY120", @@ -101,8 +87,8 @@ mag = [ "SINEG01-MCRX120","SINEG01-MCRY120", "SINEG01-MQUA320" ] for m in mag: caput(m + ":I-SET", 0.0) -#for m in mag: -# ccr(m) +for m in mag: + ccr(m) laser_on() # Scan using the screen @@ -115,12 +101,12 @@ finally: laser_off() # take the result of the scan and do the plots -#p = plot(r.getReadable(2), xdata=r.getReadable(1), title = "Centroid excursion")[0] +p = plot(r.getReadable(2), xdata=r.getReadable(1), title = "Centroid excursion")[0] # save the entry in the logbook -#msg = str(r) -#msg = msg + "\nFile: " + get_context().path +msg = str(r) +msg = msg + "\nFile: " + get_context().path #msg = msg + "\n\n" + r.print() -#elog("Gun solenoid current scan", msg , get_plot_snapshots()) +elog("Gun solenoid current scan", msg , get_plot_snapshots())