From 7bb50d44ba5301c691fc8d5069245909aef40c7e Mon Sep 17 00:00:00 2001 From: voulot_d Date: Tue, 31 Jan 2017 08:45:56 +0100 Subject: [PATCH] Script execution --- script/RFscan/ShottkyScan.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/script/RFscan/ShottkyScan.py b/script/RFscan/ShottkyScan.py index 44ee433..615cfc8 100644 --- a/script/RFscan/ShottkyScan.py +++ b/script/RFscan/ShottkyScan.py @@ -9,12 +9,12 @@ if get_exec_pars().source == CommandSource.ui: else: start = args[0] stop = args[1] - step = args[2] - nb = int(args[3]) - lat = args[4] + step = args[2] + nb = int(args[3]) + lat = args[4] -phase = ControlledVariable("Phase", "SINEG01-RSYS:SET-VSUM-PHASE-SIM", "SINEG01-RSYS:GET-VSUM-PHASE-SIM") +phase = ControlledVariable("Phase", "SINEG01-RSYS:SET-VSUM-PHASE-SIM", "SINEG01-RSYS:GET-VSUM-PHASE-SIM") phase.config.minValue =-45.0 phase.config.maxValue = 360.0 phase.config.resolution = 0.5 @@ -24,13 +24,14 @@ phase.initialize() #q = st.addScalar("Charge", "SINEG01-DICT215:B1_CHARGE-SIM", 1, 0) #st.initialize() #st.start(True) -q = Channel("SINEG01-DICT215:B1_CHARGE-SIM", type = 'd', alias='ICT-Q') +q = Channel("SINEG01-DICT215:B1_CHARGE-SIM", type = 'd', alias='ICT-Q') try: qb = create_averager(q, nb, 0.100) r = lscan(phase, (qb), start, stop, step, latency=lat) rf_phase = r.getPositions(0) charge = [val.mean for val in r.getReadable(0)] + chargerms = [val.stdev for val in r.getReadable(0)] finally: phase.close() q.close() @@ -38,9 +39,8 @@ finally: #Setting the return value #set_return(50.0) -y = r.getReadable(0) -x = r.getPositions(0) -y = [v.mean for v in y] +y = charge +x = rf_phase index_max = y.index(max(y)) phase_ref = x[index_max] - 90 phase_offset = - phase_ref