Closedown
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
import ch.psi.pshell.epics.ControlledVariable as ControlledVariable
|
||||
|
||||
if get_exec_pars().source == CommandSource.ui:
|
||||
start = 209.0
|
||||
stop = 229.0
|
||||
step = 2.0
|
||||
nb = 2
|
||||
start = 50.0
|
||||
stop = 230.0
|
||||
step = 5.0
|
||||
nb = 1
|
||||
lat = 0.100
|
||||
else:
|
||||
start = args[0]
|
||||
|
||||
@@ -46,7 +46,7 @@ def after(rec):
|
||||
|
||||
try:
|
||||
xb = create_averager(x, nb, 0.100)
|
||||
r = lscan(phase, xb, start, stop, step , latency=lat, after_read = after)
|
||||
r = lscan(phase, xb, start, stop, step, latency=lat, after_read = after)
|
||||
rf_phase = r.getPositions(0)
|
||||
energy = [val.mean/1000.0/disp*energy0 for val in r.getReadable(1)]
|
||||
caput(station + "-RSYS:GET-ENERGY-ARRAY", to_array(energy, 'd'))
|
||||
@@ -82,9 +82,9 @@ phase_offset = 90 - phase_fit_max
|
||||
amplitude_scale = energy_max / Ampl
|
||||
power_scale = Power / math.pow(Ampl,2)
|
||||
|
||||
caput(station + "-RSYS:CALC-VSUM-PHASE-OFFSET", phase_offset)
|
||||
caput(station + "-RSYS:CALC-VSUM-AMPLT-SCALE" , amplitude_scale)
|
||||
caput(station + "-RSYS:CALC-VOLT-POWER-SCALE" , power_scale)
|
||||
caput(station + "-RSYS:SET-VSUM-PHASE-OFFSET-BASE", phase_offset)
|
||||
caput(station + "-RSYS:SET-VSUM-AMPLT-SCALE", amplitude_scale)
|
||||
caput(station + "-RSYS:SET-VOLT-POWER-SCALE", power_scale)
|
||||
|
||||
#title="Phase scan "+str(station)
|
||||
#message=("Energy Gain: %0.3f" % energy_gain + "MeV\n" +
|
||||
|
||||
@@ -46,7 +46,7 @@ def after(rec):
|
||||
|
||||
try:
|
||||
xb = create_averager(x, nb, 0.100)
|
||||
r = lscan(phase, xb, start, stop, step , latency=lat, after_read = after)
|
||||
r = lscan(phase, xb, start, stop, step, latency=lat, after_read = after)
|
||||
rf_phase = r.getPositions(0)
|
||||
energy = [val.mean/1000.0/disp*energy0 for val in r.getReadable(0)]
|
||||
caput(station + "-RSYS:GET-ENERGY-ARRAY", to_array(energy, 'd'))
|
||||
|
||||
Reference in New Issue
Block a user