This commit is contained in:
voulot_d
2017-01-13 13:25:48 +01:00
parent d1d506a207
commit cd84564ed8

View File

@@ -1,7 +1,5 @@
import ch.psi.pshell.epics.ControlledVariable as ControlledVariable
latency = 0.05
if get_exec_pars().source == CommandSource.ui:
prefix = "SINSB04-RSYS"
else:
@@ -48,7 +46,10 @@ def after(rec):
caput(prefix + ":GET-PHASE-ARRAY", to_array(arr_phase,'d'))
try:
r = lscan(rf_phase_var, [rf_ampl_rbk, bpm_x], start, stop, step , latency=lat, passes=2, after_read = after)
av_ampl = create_averager(rf_ampl_rbk, nb, lat)
av_x = create_averager(bpm_x, nb, lat)
r = lscan(rf_phase_var, [(av_ampl, av_ampl.samples), (av_x, av_x.samples)], start, stop, step , latency=lat, after_read = after)
rf_phase = r.getPositions(0)
energy = [x/1000.0/disp*energy0 for x in r.getReadable(1)]
caput(prefix + ":GET-ENERGY-ARRAY", to_array(energy,'d'))