From 5c71cc660619dbedf602229b032cf0050ca1dce1 Mon Sep 17 00:00:00 2001 From: klaute Date: Fri, 7 Oct 2016 19:55:22 +0200 Subject: [PATCH] Fixed the CSV file output/generation. --- tools/meas.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/tools/meas.py b/tools/meas.py index 9b357eb..4100307 100644 --- a/tools/meas.py +++ b/tools/meas.py @@ -498,10 +498,10 @@ def update_graph(): if config_read == True and config_lines == False: x = arange(start_freq, end_freq, step_freq) - lvswr, = axarr[0].plot(x[0], meas_vswr[-1], label='VSWR', markevery=[vswr_marker[0]], markersize=4, marker="o", markerfacecolor="r") - limp, = axarr[1].plot(x[0], meas_imp[-1], label='impedance', markevery=[vswr_marker[0]], markersize=4, marker="o", markerfacecolor="r") - la0, = axarr[2].plot(x[0], meas_a0[-1], label='a0')#, markersize=4, marker="o", markerfacecolor="r") - la1, = axarr[2].plot(x[0], meas_a1[-1], label='a1')#, markersize=4, marker="o", markerfacecolor="r") + lvswr, = axarr[0].plot(x[0], [1], label='VSWR', markevery=[vswr_marker[0]], markersize=4, marker="o", markerfacecolor="r") + limp, = axarr[1].plot(x[0], [50], label='impedance', markevery=[vswr_marker[0]], markersize=4, marker="o", markerfacecolor="r") + la0, = axarr[2].plot(x[0], [512], label='a0') + la1, = axarr[2].plot(x[0], [512], label='a1') axarr[0].legend(handles=[lvswr]) axarr[0].set_xlim([start_freq, end_freq]) @@ -710,14 +710,21 @@ if __name__ == "__main__": sys.stdout.write("\r100.00 % done \n") print "" - if (args.output_file != None or args.show_graph == True) and args.start_meas == True: - calc_data() + #if (args.output_file != None or args.show_graph == True) and args.start_meas == True: + #calc_data() ##### generate the output CSV file if args.output_file != None and args.start_meas == True: FILE = open(args.output_file, "w") FILE.write("freqency;ratio;impedance;drive;a0;a1\n") j = 0 + i = ((drive_str + 1) * 2.0) / 1000.0 + print meas_vswr + print meas_freq + print meas_imp + print meas_data + print meas_data[j] + print meas_data[j] for m in meas_vswr: FILE.write("%f;%f;%f;%f;%d;%d\n" % (meas_freq[j], m, meas_imp[j], i, meas_data[j][1], meas_data[j][2])) j = j + 1