Closedown
This commit is contained in:
@@ -11,7 +11,6 @@
|
||||
|
||||
|
||||
import org.apache.commons.math3.linear.Array2DRowRealMatrix as Matrix
|
||||
import ch.psi.utils.Convert.toBidimensional as mono_to_bidi
|
||||
import datetime
|
||||
from camtool import CamTool
|
||||
#run("camtool")
|
||||
@@ -38,29 +37,16 @@ plot_name = datetime.datetime.fromtimestamp(time.time()).strftime('%H%M%S')
|
||||
|
||||
|
||||
add_device(CamTool("camtool") , True)
|
||||
camtool.enableBackground (use_background)
|
||||
|
||||
number_images = 1
|
||||
use_background = True
|
||||
multiple_background = True
|
||||
number_backgrounds = 5
|
||||
|
||||
|
||||
cam_x =camtool.cam_x # Channel("SINEG01-DSCR190:profile.X_stats.com", alias = "cam_x")
|
||||
cam_y = camtool.cam_y #Channel("SINEG01-DSCR190:profile.Y_stats.com", alias = "cam_y")
|
||||
profile_x = camtool.profile_x #Channel("SINEG01-DSCR190:profile.X", alias = "profile_x")
|
||||
profile_y = camtool.profile_y #Channel("SINEG01-DSCR190:profile.Y", alias = "profile_y")
|
||||
cam_raw_data = camtool.cam_image #Channel("SINEG01-DSCR190:data")
|
||||
|
||||
|
||||
class CameraImage(ReadableMatrix):
|
||||
def read(self):
|
||||
raw = cam_raw_data.read()
|
||||
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
|
||||
|
||||
def getHeight(self):
|
||||
return self._height
|
||||
|
||||
cam_img = CameraImage()
|
||||
cam_img._width = len(profile_x.read())
|
||||
cam_img._height = len(profile_y.read())
|
||||
|
||||
|
||||
def ccr(mag):
|
||||
@@ -117,7 +103,7 @@ def ar():
|
||||
r = None
|
||||
laser_on()
|
||||
try:
|
||||
sensors = [cam_x, cam_y, cam_img] if plot_image else [cam_x, cam_y]
|
||||
sensors = [cam_x, cam_y, camtool.image] if plot_image else [cam_x, cam_y]
|
||||
r = lscan(gun_solenoid, sensors , I1, I2, dI, settling_time, before_read = br, after_read = ar)
|
||||
finally:
|
||||
laser_off()
|
||||
@@ -136,10 +122,8 @@ if do_elog:
|
||||
msg = msg + "\n\n" + r.print()
|
||||
elog("Gun solenoid current scan", msg , get_plot_snapshots())
|
||||
|
||||
print "QUITING"
|
||||
set_return([r, hx,hy])
|
||||
|
||||
print "QUIT"
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user