diff --git a/script/RFscan/RF_phase_scan.py b/script/RFscan/RF_phase_scan.py index 6106e34..156cc91 100644 --- a/script/RFscan/RF_phase_scan.py +++ b/script/RFscan/RF_phase_scan.py @@ -1,15 +1,20 @@ rsys = "SINSB01-RSYS" bpm = "SINLH02-DBPM210" -phase_start = -175.0 -phase_stop = 180.0 -phase_step = 5.0 +phi1 = -175.0 +phi2 = 180.0 +dphi = 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") +def laser_on(): + caput("SIN-CVME-TIMAST-TMA:LaserDelayControl", 0) +def laser_off(): + caput("SIN-CVME-TIMAST-TMA:LaserDelayControl", 1) -r = lscan(rf_phase_setpoint, [rf_phase_readback, rf_ampl_readback, x1], phase_start, phase_stop, phase_step, latency=0.5) +phi_set = Channel(rsys + ":SET-VSUM-PHASE") +phi_get = Channel(rsys + ":GET-VSUM-PHASE") +amp_get = Channel(rsys + ":GET-VSUM-AMPLT") +bpm_x = Channel(bpm + ":X1") + +r = lscan(phi_set, [phi_get, amp_get, bpm_x], phi1, phi2, dphi, 0.5, before_read = laser_on(), after_read = laser_off()) plot(r.getReadable(2), xdata = r.getReadable(0), title = "Phase scan")