Files
sf-rf/script/RF_phase_scan.py
2016-05-30 09:54:30 +02:00

21 lines
663 B
Python

rsys = "SINSB01-RSYS"
bpm = "SINLH02-DBPM210"
phase_start = -175.0
phase_stop = 180.0
phase_step = 5.0
rf_phase_setpoint = Channel(rsys + ":SET-VSUM-PHASE")
rf_phase_readback = Channel(rsys + ":GET-VSUM-PHASE")
rf_ampl_readback = Channel(rsys + ":GET-VSUM-AMPLT")
x1 = Channel(bpm + ":X1")
r = lscan(rf_phase_setpoint, [rf_phase_readback, rf_ampl_readback, x1], phase_start, phase_stop, phase_step, latency=0.5)
plot(r.getReadable(2), xdata = r.getReadable(0), title = "phase scan")
(amplitude, angular_frequency, phase, ok, maximum) = hfit(r.getReadable(2), xdata = r.getReadable(0))
caput(rsys + ":SET-ON-CREST-VSUM-PHASE", maximum)
set_return(r.print())