diff --git a/script/RF_phase_scan.py b/script/RF_phase_scan.py new file mode 100644 index 0000000..7a4b721 --- /dev/null +++ b/script/RF_phase_scan.py @@ -0,0 +1,20 @@ +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())