Closedown
This commit is contained in:
@@ -19,7 +19,7 @@ if get_context().source == CommandSource.ui:
|
||||
dI = 1.0
|
||||
settling_time = 0.1
|
||||
plot_image = False
|
||||
number_images = 1
|
||||
number_images = 5
|
||||
use_background = True
|
||||
multiple_background = False
|
||||
number_backgrounds = 5
|
||||
@@ -29,8 +29,6 @@ if get_context().source == CommandSource.ui:
|
||||
else:
|
||||
centroid_excursion_plot = False
|
||||
|
||||
LASER_SETTLING_TIME = 0.1
|
||||
|
||||
print "Parameters: ", I1, I2, dI, settling_time, plot_image, number_images, use_background, multiple_background, number_backgrounds
|
||||
|
||||
plot_name = datetime.datetime.fromtimestamp(time.time()).strftime('%H%M%S')
|
||||
@@ -44,22 +42,6 @@ if use_background and not multiple_background:
|
||||
camtool.captureBackground(number_backgrounds)
|
||||
multiple_background = multiple_background and use_background
|
||||
|
||||
def ccr(mag):
|
||||
n = 1
|
||||
while n > 0:
|
||||
sleep(0.5)
|
||||
n = caget(mag + ":I-COMP")
|
||||
|
||||
def laser_on():
|
||||
print "Laser On"
|
||||
#caput("SIN-TIMAST-TMA:Beam-Las-Delay-Sel", 0)
|
||||
time.sleep(LASER_SETTLING_TIME)
|
||||
|
||||
def laser_off():
|
||||
print "Laser Off"
|
||||
#caput("SIN-TIMAST-TMA:Beam-Las-Delay-Sel", 1)
|
||||
time.sleep(LASER_SETTLING_TIME)
|
||||
|
||||
|
||||
# Switch off magnets
|
||||
mag = [ "SINEG01-MCRX120","SINEG01-MCRY120",
|
||||
@@ -71,11 +53,8 @@ mag = [ "SINEG01-MCRX120","SINEG01-MCRY120",
|
||||
"SINEG01-MCRX220","SINEG01-MCRY220",
|
||||
"SINEG01-MQUA310",
|
||||
"SINEG01-MQUA320" ]
|
||||
if zero_solenoids:
|
||||
for m in mag:
|
||||
caput(m + ":I-SET", 0.0)
|
||||
for m in mag:
|
||||
ccr(m)
|
||||
if zero_solenoids:
|
||||
switchOffMagnets(mag)
|
||||
|
||||
# add here gun phase setting see wiki page
|
||||
|
||||
@@ -96,7 +75,7 @@ if not multiple_background:
|
||||
laser_on()
|
||||
try:
|
||||
#sensors = [camtool.com_x, camtool.com_y]
|
||||
sensors = [camtool.com_x_mean, camtool.com_y_mean]
|
||||
sensors = [camtool.com_x_mean, camtool.com_y_mean, camtool.com_x_var, camtool.com_y_var]
|
||||
if plot_image:
|
||||
sensors.append(camtool.image)
|
||||
r = lscan(gun_solenoid, sensors , I1, I2, dI, settling_time, before_read = br, after_read = ar)
|
||||
|
||||
Reference in New Issue
Block a user