Script execution
This commit is contained in:
@@ -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())
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user