Closedown
This commit is contained in:
@@ -30,6 +30,9 @@ else:
|
||||
#from camtool import CamTool
|
||||
run("camtool")
|
||||
#from ImageStats import ImageStats, get_simulated_source
|
||||
|
||||
laser_was_on = is_laser_on()
|
||||
original_gun_solenoid = gun_solenoid.read()
|
||||
|
||||
|
||||
multiple_background = multiple_background and use_background
|
||||
@@ -96,7 +99,13 @@ finally:
|
||||
#laser_off()
|
||||
pass
|
||||
|
||||
image_stats.stop()
|
||||
#image_stats.stop()
|
||||
|
||||
gun_solenoid.write(original_gun_solenoid)
|
||||
if laser_was_on:
|
||||
laser_on()
|
||||
else:
|
||||
laser_off()
|
||||
|
||||
|
||||
# take the result of the scan and generate convex hull plot
|
||||
|
||||
@@ -33,6 +33,8 @@ run("camtool")
|
||||
#from BpmStats import BpmStats
|
||||
|
||||
|
||||
laser_was_on = is_laser_on()
|
||||
original_phase = gun_phase.read()
|
||||
multiple_background = multiple_background and use_background
|
||||
print "Parameters: ", phi1, phi2, dphi, settling_time, plot_image, number_images, use_background, multiple_background, number_backgrounds
|
||||
|
||||
@@ -95,9 +97,14 @@ try:
|
||||
r = lscan(gun_phase, sensors , phi1, phi2, dphi, settling_time, before_read = before_sample, after_read = after_sample)
|
||||
finally:
|
||||
pass
|
||||
#laser_off()
|
||||
|
||||
image_stats.stop()
|
||||
#image_stats.stop()
|
||||
|
||||
gun_phase.write(original_phase)
|
||||
if laser_was_on:
|
||||
laser_on()
|
||||
else:
|
||||
laser_off()
|
||||
|
||||
|
||||
# take the result of the scan and generate convex hull plot
|
||||
@@ -110,11 +117,12 @@ else:
|
||||
|
||||
# save the entry in the logbook
|
||||
gsa_log_msg = "Data file: " + get_context().path
|
||||
gsa_log_msg = gsa_log_msg + "\nImages: " + str(number_images)
|
||||
gsa_log_msg = gsa_log_msg + "\nBackground: enabled=" + str(use_background) + " multiple=" + str(multiple_background) + " number=" + str(number_backgrounds)
|
||||
gsa_log_msg = gsa_log_msg + "\nImages: " + str(number_images) + " Background: enabled=" + str(use_background) + " multiple=" + str(multiple_background) + " number=" + str(number_backgrounds)
|
||||
gsa_log_msg = gsa_log_msg + "\nPhase range: " + str(phi1) + " to " + str(phi2)
|
||||
gsa_log_msg = gsa_log_msg + "\nLaser position on cathod: " + str(caget("SLG-LCAM-C103:FIT-XPOS")) + "/" + str(caget("SLG-LCAM-C103:FIT-YPOS"))
|
||||
gsa_log_msg = gsa_log_msg + "\n\n" + r.print()
|
||||
if do_elog:
|
||||
elog("Gun phasee scan", gsa_log_msg , get_plot_snapshots())
|
||||
elog("Laser alignment with phase scan", gsa_log_msg , get_plot_snapshots())
|
||||
|
||||
_=[r, hx, hy]
|
||||
set_return([r, hx, hy])
|
||||
|
||||
Reference in New Issue
Block a user