This commit is contained in:
sfop
2017-04-25 13:59:03 +02:00
parent 4c66ec7b6f
commit 0cc8ec5c9e
12 changed files with 683 additions and 383 deletions
+19 -17
View File
@@ -1,33 +1,34 @@
import ch.psi.pshell.epics.ControlledVariable as ControlledVariable
import ch.psi.pshell.epics.Camtool as Camtool
import ch.psi.pshell.epics.ControlledVariable as ControlledVariable
import ch.psi.pshell.epics.Camtool as Camtool
if get_exec_pars().source == CommandSource.ui:
start = 55.0
stop = 75.0
start = -34.0
stop = -14.0
step = 2.0
nb = 5
lat = 0.5
disp = caget("SINBD01-DSCR010:DISPERSION")
energy0 = caget("SINBD01-DSCR010:ENERGY")
nb = 1
lat = 0.3
disp = -0.32
energy0 = 7.1
else:
start = args[0]
stop = args[1]
step = args[2]
nb = int(args[3])
lat = args[4]
start = args[0]
stop = args[1]
step = args[2]
nb = int(args[3])
lat = args[4]
disp = args[5]
energy0 = args[6]
#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 = ControlledVariable("Phase", "SINEG01-RSYS:SET-VSUM-PHASE", "SINEG01-RSYS:GET-VSUM-PHASE")
phase.config.minValue =-180.0
phase.config.maxValue = 180.0
phase.config.maxValue = 360.0
phase.config.precision = 3
phase.config.resolution = 1.0
phase.config.save()
phase.initialize()
#kill_camtool()
phase0 = phase.read()
kill_camtool()
check_camtool()
camtool.start("SINBD01-DSCR010")
wait_camtool_message()
@@ -44,6 +45,7 @@ try:
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)]
finally:
phase.write(phase0)
phase.close()
camtool.stop() # stops camtool but does not close it camtool is a global object