Closedown

This commit is contained in:
gobbo_a
2017-04-13 15:18:53 +02:00
parent 31f29baa65
commit 8ddf2e0f9d
4 changed files with 37 additions and 26 deletions

View File

@@ -7,8 +7,8 @@ if get_exec_pars().source == CommandSource.ui:
step = 2.0
nb = 5
lat = 0.5
disp = caget("SINBD01-DSCR010:DISPERSION-SIM")
energy0 = caget("SINBD01-DSCR010:ENERGY-SIM")
disp = caget("SINBD01-DSCR010:DISPERSION")
energy0 = caget("SINBD01-DSCR010:ENERGY")
else:
start = args[0]
stop = args[1]
@@ -18,11 +18,13 @@ else:
disp = args[5]
energy0 = args[6]
phase = ControlledVariable("Phase", "SINEG01-RSYS:SET-VSUM-PHASE", "SINEG01-RSYS:SET-VSUM-PHASE")
#phase = ControlledVariable("Phase", "SINEG01-RSYS:SET-VSUM-PHASE", "SINEG01-RSYS:GET-VSUM-PHASE")
phase = ControlledVariable("Phase", "SINEG01-RSYS:SET-VSUM-PHASE", "SINEG01-RSYS:SET-VSUM-PHASE")
phase.config.minValue =-180.0
phase.config.maxValue = 180.0
phase.config.resolution = 0.25
phase.config.precision = 3
phase.config.resolution = 1.0
phase.config.save()
phase.initialize()
#kill_camtool()
@@ -30,7 +32,7 @@ check_camtool()
camtool.start("SINBD01-DSCR010")
wait_camtool_message()
x = camtool.stream.getChild("gr_x_fit_mean")
x = camtool.stream.getChild("gr_x_fit_mean")
dx = camtool.stream.getChild("gr_x_fit_standard_deviation")
try:
@@ -40,7 +42,7 @@ try:
r = lscan(phase, [xb, dxb], start, stop, step , latency=lat)
rf_phase = r.getPositions(0)
E = [energy0 * (1 + val.mean / 1e6 / disp) for val in r.getReadable(0)]
dE = [energy0 * (val.mean / 1e6 / disp) for val in r.getReadable(1)]
dE = [energy0 * ( val.mean / 1e6 / disp) for val in r.getReadable(1)]
finally:
phase.close()
camtool.stop() # stops camtool but does not close it camtool is a global object

View File

@@ -13,11 +13,11 @@ else:
nb = int(args[3])
lat = args[4]
#phase = ControlledVariable("Phase", "SINEG01-RSYS:SET-VSUM-PHASE", "SINEG01-RSYS:GET-VSUM-PHASE")
phase = ControlledVariable("Phase", "SINEG01-RSYS:SET-VSUM-PHASE", "SINEG01-RSYS:SET-VSUM-PHASE")
phase.config.minValue =-180.0
phase.config.maxValue = 180.0
phase.config.precision = 3
phase.config.precision = 3
phase.config.resolution = 1.0
phase.config.save()
phase.initialize()