Closedown
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
|
||||
import datetime
|
||||
from camtool import CamTool
|
||||
from ImageStats import ImageStats
|
||||
|
||||
if get_context().source == CommandSource.ui:
|
||||
I1 = 95.0
|
||||
@@ -31,16 +32,14 @@ print "Parameters: ", I1, I2, dI, settling_time, plot_image, number_images, use_
|
||||
|
||||
plot_name = datetime.datetime.fromtimestamp(time.time()).strftime('%H%M%S')
|
||||
|
||||
#add_device(CamTool("camtool") , True)
|
||||
#from ImageStats import *
|
||||
run("ImageStats")
|
||||
add_device(ImageStats("camtool", simulated_source), True)
|
||||
camtool.setNumberOfImages(max(number_images,1))
|
||||
camtool.enableBackground (use_background)
|
||||
add_device(CamTool("image_stats", prefix = "cam:", latch = True, camera = "SINEG01-DSCR350"), True)
|
||||
#add_device(ImageStats("image_stats", simulated_source), True)
|
||||
image_stats.setNumberOfImages(max(number_images,1))
|
||||
image_stats.enableBackground (use_background)
|
||||
if use_background:
|
||||
laser_off()
|
||||
if not multiple_background:
|
||||
camtool.captureBackground(number_backgrounds)
|
||||
image_stats.captureBackground(number_backgrounds)
|
||||
|
||||
# Switch off magnets
|
||||
mag = [ "SINEG01-MCRX120","SINEG01-MCRY120",
|
||||
@@ -59,9 +58,9 @@ mag = [ "SINEG01-MCRX120","SINEG01-MCRY120",
|
||||
|
||||
def before_sample():
|
||||
if multiple_background:
|
||||
camtool.captureBackground(number_backgrounds)
|
||||
image_stats.captureBackground(number_backgrounds)
|
||||
laser_on()
|
||||
camtool.update()
|
||||
image_stats.update()
|
||||
|
||||
def after_sample():
|
||||
if multiple_background:
|
||||
@@ -72,10 +71,10 @@ if not multiple_background:
|
||||
laser_on()
|
||||
|
||||
try:
|
||||
#sensors = [camtool.com_x, camtool.com_y]
|
||||
sensors = [camtool.com_x_mean, camtool.com_y_mean, camtool.com_x_stdev, camtool.com_y_stdev]
|
||||
#sensors = [image_stats.com_x, image_stats.com_y]
|
||||
sensors = [image_stats.com_x_mean, image_stats.com_y_mean, image_stats.com_x_stdev, image_stats.com_y_stdev]
|
||||
if plot_image:
|
||||
sensors.append(camtool.image)
|
||||
sensors.append(image_stats.image)
|
||||
r = lscan(gun_solenoid, sensors , I1, I2, dI, settling_time, before_read = before_sample, after_read = after_sample)
|
||||
finally:
|
||||
laser_off()
|
||||
|
||||
Reference in New Issue
Block a user