This commit is contained in:
sfop
2017-06-02 11:04:51 +02:00
parent a64a0c8882
commit 28d68c9e3a
3 changed files with 37 additions and 6 deletions
+3 -3
View File
@@ -1,7 +1,7 @@
#Fri Jun 02 09:27:53 CEST 2017
#Fri Jun 02 10:37:36 CEST 2017
colormap=Flame
colormapAutomatic=false
colormapMax=400.0
colormapAutomatic=true
colormapMax=0.0
colormapMin=0.0
flipHorizontally=false
flipVertically=false
+3 -3
View File
@@ -1,12 +1,12 @@
#Thu May 11 08:37:16 CEST 2017
#Fri Jun 02 10:56:08 CEST 2017
defaultSpeed=6000.0
estbilizationDelay=0
hasEnable=false
homingType=None
maxSpeed=8000.0
maxValue=51500.0
maxValue=200000.0
minSpeed=50.0
minValue=-56789.2
minValue=-200000.0
offset=0.0
precision=1
resolution=0.1
+31
View File
@@ -0,0 +1,31 @@
import ch.psi.pshell.epics.ControlledVariable as ControlledVariable
import ch.psi.pshell.epics.Camtool as Camtool
phase = ControlledVariable("Phase", "SINEG01-RSYS:SET-BEAM-PHASE", "SINEG01-RSYS:GET-BEAM-PHASE")
phase.config.minValue =-180.0
phase.config.maxValue = 360.0
phase.config.precision = 3
phase.config.resolution = 1.0
phase.config.save()
phase.initialize()
kill_camtool()
check_camtool()
camtool.start("SINBD01-DSCR010")
wait_camtool_message()
x = camtool.stream.getChild("gr_x_fit_mean")
dx = camtool.stream.getChild("gr_x_fit_standard_deviation")
try:
xb = create_averager(x, nb, -1) # -1 event based, waits for the next value
dxb = create_averager(dx, nb, -1)
dxb.monitored=True # not blocking, will return last nb values
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)]
finally:
phase.write(phase0)
phase.close()
camtool.stop() # stops camtool but does not close it camtool is a global object