This commit is contained in:
voulot_d
2017-04-20 12:13:08 +02:00
parent 3726225681
commit a7cc5f866c
2 changed files with 17 additions and 16 deletions

View File

@@ -1,7 +1,7 @@
#Wed Apr 19 16:17:06 CEST 2017
#Thu Apr 20 11:04:47 CEST 2017
colormap=Flame
colormapAutomatic=true
colormapMax=0.0
colormapMax=200.0
colormapMin=0.0
flipHorizontally=false
flipVertically=false
@@ -21,9 +21,9 @@ rotation=0.0
rotationCrop=false
scale=1.0
serverURL=localhost\:10000
spatialCalOffsetX=-87.38325966970284
spatialCalOffsetY=-54.36734816477289
spatialCalScaleX=-26.761819847879956
spatialCalScaleY=-26.595745475924744
spatialCalOffsetX=-1093.4812581603794
spatialCalOffsetY=-1098.5114274849898
spatialCalScaleX=-7.617446798629459
spatialCalScaleY=-7.774538463917676
spatialCalUnits=mm
transpose=false

View File

@@ -1,7 +1,7 @@
import ch.psi.pshell.epics.ControlledVariable as ControlledVariable
if get_exec_pars().source == CommandSource.ui:
station = "SINSB04"
station = "STEST01"
bpm_ch = "SINBC02-DBPM140"
else:
station = args[0]
@@ -15,15 +15,18 @@ nb = caget(station + "-RSYS:SET-NUM-AVERAGE")
disp = caget(bpm_ch + ":DISPERSION")
energy0 = caget(bpm_ch + ":ENERGY")
phase = ControlledVariable("Phase", station + "-RSYS:SET-VSUM-PHASE-SIM", station + "-RSYS:GET-VSUM-PHASE-SIM")
phase.config.minValue =-45.0
phase = ControlledVariable("Phase", station + "-RSYS:SET-VSUM-PHASE", station + "-RSYS:SET-VSUM-PHASE")
phase.config.minValue =-180.0
phase.config.maxValue = 360.0
phase.config.resolution = 0.5
phase.initialize()
V = Channel(station + "-RSYS:GET-VSUM-AMPLT-SIM", type = 'd', alias='Amplitude Readback')
P = Channel(station + "-RSYS:GET-KLY-POWER-SIM", type = 'd', alias='Power Readback')
x = Channel(bpm_ch + ":X1-SIMU", type = 'd', alias='BPM-X')
V = Channel(station + "-RSYS:GET-VSUM-AMPLT", type = 'd', alias='Amplitude Readback')
P = Channel(station + "-RSYS:GET-KLY-POWER", type = 'd', alias='Power Readback')
x = Channel(bpm_ch + ":X1-SIMU", type = 'd', alias='BPM-X')
phase0 = phase.read()
caput(station + "-RSYS:GET-FIT-PHASE-ARRAY", to_array([0.0],'d'))
caput(station + "-RSYS:GET-FIT-ENERGY-ARRAY", to_array([0.0],'d'))
@@ -31,9 +34,6 @@ caput(station + "-RSYS:GET-ONCREST-VSUM-PHASE", float('nan'))
caput(station + "-RSYS:GET-ONCREST-VSUM-AMPLT", float('nan'))
caput(station + "-RSYS:GET-ONCREST-E-GAIN", float('nan'))
caput(station + "-RSYS:GET-ONCREST-KLY-POWER", float('nan'))
caput(station + "-RSYS:CALC-VSUM-PHASE-OFFSET", float('nan'))
caput(station + "-RSYS:CALC-VSUM-AMPLT-SCALE" , float('nan'))
caput(station + "-RSYS:CALC-VOLT-POWER-SCALE" , float('nan'))
#update the plot dynamically
arr_phase,arr_energy = [],[]
@@ -41,8 +41,8 @@ def after(rec):
global disp, energy0
arr_phase.append(rec.positions[0])
arr_energy.append(rec.values[0].mean/1000.0/disp*energy0)
caput(station + "-RSYS:GET-ENERGY-ARRAY", to_array(arr_energy,'d'))
caput(station + "-RSYS:GET-PHASE-ARRAY", to_array(arr_phase, 'd'))
caput(station + "-RSYS:GET-ENERGY-ARRAY", to_array(arr_energy,'d'))
try:
xb = create_averager(x, nb, 0.100)
@@ -70,6 +70,7 @@ try:
caput(station + "-RSYS:GET-ONCREST-VSUM-AMPLT", Ampl)
caput(station + "-RSYS:GET-ONCREST-KLY-POWER", Power)
finally:
phase.write(phase0)
phase.close()
V.close()
P.close()