From 9bc6cd4bedca42f954ae4812a9ea191e3f4e10e7 Mon Sep 17 00:00:00 2001 From: sfop Date: Thu, 16 Feb 2017 18:57:15 +0100 Subject: [PATCH] Script execution --- script/RFscan/phase_scan_caqtdm_sim.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/script/RFscan/phase_scan_caqtdm_sim.py b/script/RFscan/phase_scan_caqtdm_sim.py index 90def98..b27e5a3 100644 --- a/script/RFscan/phase_scan_caqtdm_sim.py +++ b/script/RFscan/phase_scan_caqtdm_sim.py @@ -45,11 +45,10 @@ def after(rec): caput(station + "-RSYS:GET-PHASE-ARRAY", to_array(arr_phase, 'd')) try: - Vb = create_averager(V, nb, 0.100) xb = create_averager(x, nb, 0.100) - r = lscan(phase, [Vb, 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)] + energy = [val.mean/1000.0/disp*energy0 for val in r.getReadable(0)] caput(station + "-RSYS:GET-ENERGY-ARRAY", to_array(energy, 'd')) caput(station + "-RSYS:GET-PHASE-ARRAY", to_array(rf_phase,'d')) phase_fit_max = None @@ -79,9 +78,8 @@ finally: print ("------------------------------------") print ("Valid fit") -energy_gain = energy_max phase_offset = 90 - phase_fit_max -amplitude_scale = energy_gain / Ampl +amplitude_scale = energy_max / Ampl power_scale = Power / math.pow(Ampl,2) caput(station + "-RSYS:SET-VSUM-PHASE-OFFSET-BASE", phase_offset)