From b237ba6a099581e1f7dad37f06b2b45cedb9b702 Mon Sep 17 00:00:00 2001 From: sfop Date: Tue, 14 Feb 2017 15:14:22 +0100 Subject: [PATCH] Script execution --- script/RFscan/GunScan.py | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/script/RFscan/GunScan.py b/script/RFscan/GunScan.py index 49c74c4..38a713d 100644 --- a/script/RFscan/GunScan.py +++ b/script/RFscan/GunScan.py @@ -24,12 +24,12 @@ phase.config.resolution = 0.5 phase.initialize() #camtool = Camtool("sflca:10000") -#camtool.startPipeline("simulated") -#camtool.startReceiver() -#x = camtool.getValue("x_com") -#dx = camtool.getValue("x_rms") -x = Channel("SINEG01-DSCR190:X-SIM", type = 'd', alias='SCR-X') -dx = Channel("SINEG01-DSCR190:DX-SIM", type = 'd', alias='SCR-DX') +camtool.start("simulated") +x = camtool.getValue("gr_x_fit_mean") +dx = camtool.getValue("gr_x_fit_standard_deviation") + +#x = Channel("SINEG01-DSCR190:X-SIM", type = 'd', alias='SCR-X') +#dx = Channel("SINEG01-DSCR190:DX-SIM", type = 'd', alias='SCR-DX') try: @@ -43,12 +43,11 @@ finally: phase.close() # camtool.close() -print rf_phase -xx = [0.0, 30.0, 60.0, 90.0, 120.0, 150.0, 180.0] -print xx - -p = plot(None,name="Phase scan")[0] -p.addSeries(LinePlotSeries("data")) -p.getSeries(0).setData(xx, E) -p.getSeries(1).setData(rf_phase, dE) +p = plot(None)[0] +p.clear() +p.addSeries(LinePlotSeries("Energy")) +p.addSeries(LinePlotSeries("Energy spread")) +p.getSeries(0).setData(to_array(rf_phase, 'd'), E) +p.getSeries(1).setData(to_array(rf_phase, 'd'), dE) +p.setLegendVisible(True) #plot((E, dE), xdata = rf_phase, title="Phase scan")