This commit is contained in:
2016-07-04 16:31:32 +02:00
parent 396886402e
commit 5d68da007e

View File

@@ -8,15 +8,7 @@ lat = caget(prefix + ":SET-SCAN-WAIT-TIME")
nb = caget(prefix + ":SET-NUM-AVERAGE")
bpm_ch = caget(prefix + ":BPM")
disp = caget(bpm_ch + ":DISPERSION")
print "Prefix = ", prefix
print "Start = ", start
print "Stop = ", stop
print "Step = ", step
print "Latency = ", latency
print "Average = ", nb
print "BPM = ", bpm_ch
print "Disp. = ", disp
energy = caget(bpm_ch + ":ENERGY")
rf_phase_var = ControlledVariable("Phase", prefix + ":SET-VSUM-PHASE-SIM", prefix + ":GET-VSUM-PHASE-SIM")
rf_phase_var.config.minValue =-180.0
@@ -36,7 +28,7 @@ try:
r = lscan(rf_phase_var, [rf_ampl_rbk, bpm_x], start, stop, step , latency=lat, passes = nb, after_read = after)
rf_phase = r.getPositions(0)
energy = r.getReadable(1) * disp
energy = r.getReadable(1) / 1000 / disp * energy
phase_fit_max = None
try:
@@ -70,7 +62,7 @@ caput(prefix + ":CALC-VSUM-PHASE-OFFSET", phase_offset)
caput(prefix + ":CALC-VSUM-AMPLT-SCALE" , amplitude_scale)
caput(prefix + ":CALC-VOLT-POWER-SCALE" , power_scale)
set_return("Energy Gain: " + str(energy_gain) + "\n" +
set_return("Energy Gain: " + str(energy_gain) + "\n" +
"Phase Offset: " + str(phase_offset) + "\n" +
"Amplitude Scale: " + str(amplitude_scale) + "\n" +
"Power Scale: " + str(power_scale))