From 1861db6fc81b0ba472a09dd0073d93c2b189a9d6 Mon Sep 17 00:00:00 2001 From: sfop Date: Tue, 5 Jul 2016 12:23:06 +0200 Subject: [PATCH] Script execution --- script/RFscan/phase_scan_caqtdm_dv.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/script/RFscan/phase_scan_caqtdm_dv.py b/script/RFscan/phase_scan_caqtdm_dv.py index 2c4fae2..5fd3dd6 100644 --- a/script/RFscan/phase_scan_caqtdm_dv.py +++ b/script/RFscan/phase_scan_caqtdm_dv.py @@ -22,17 +22,22 @@ rf_ampl_rbk = Channel(prefix + ":GET-VSUM-AMPLT-SIM", type = 'd', alias='Ampli rf_power_rbk = Channel(prefix + ":GET-KLY-POWER-SIM", type = 'd', alias='Power Readback') bpm_x = Channel(bpm_ch + ":X1-SIM", type = 'd', alias='BPM-X') -#TODO: update the plot dynamically +#update the plot dynamically +arrpos,arrval = [],[] def after(rec): - pass - + global arrpos,arrval, disp, energy0 + arrval.append(rec.values[0]/1000.0/disp*energy0) + arrpos.append(rec.positions[0]) + caput(prefix + ":GET-PHASE-ARRAY", to_array(rf_phase,'d')) + caput(prefix + ":GET-ENERGY-ARRAY", to_array(energy,'d')) + try: - r = lscan(rf_phase_var, [rf_ampl_rbk, bpm_x], start, stop, step , latency=lat, passes = nb, after_read = after) + r = lscan(rf_phase_var, [rf_ampl_rbk, bpm_x], start, stop, step , latency=lat, after_read = after) rf_phase = r.getPositions(0) energy = [x/1000.0/disp*energy0 for x in r.getReadable(1)] - caput(prefix + ":GET-PHASE-ARRAY", rf_phase) - caput(prefix + ":GET-ENERGY-ARRAY", energy) + caput(prefix + ":GET-PHASE-ARRAY", to_array(rf_phase,'d')) + caput(prefix + ":GET-ENERGY-ARRAY", to_array(energy,'d')) phase_fit_max = None try: