From 8ce6ddc8692b4646ffc5e43c581ccb5a32155bf5 Mon Sep 17 00:00:00 2001 From: klaute Date: Sat, 24 Sep 2016 21:45:37 +0200 Subject: [PATCH] Update 'tools/meas.py' Floatingpoint calculation fixed. --- tools/meas.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/meas.py b/tools/meas.py index fc5c73f..aafe71f 100644 --- a/tools/meas.py +++ b/tools/meas.py @@ -508,10 +508,10 @@ if __name__ == "__main__": if m[1] > 0 and m[2] > 0: if m[1] > m[2]: - vswr = (m[1] / m[2]) + vswr = (1.0 * m[1] / m[2]) meas_ratio.append(vswr) elif m[1] < m[2]: - vswr = (m[2] / m[1]) + vswr = (1.0 * m[2] / m[1]) meas_ratio.append(vswr) else: vswr = 1 @@ -539,7 +539,7 @@ if __name__ == "__main__": FILE.write("freqency;ratio;impedance;watt;drive;a0;a1\n") j = 0 for m in meas_ratio: - FILE.write("%f;%f;%f;%f;%f;%d,%d\n" % (meas_freq[j], m, meas_r[j], meas_p[j], i, meas_data[j][1], meas_data[j][2])) + FILE.write("%f;%f;%f;%f;%f;%d;%d\n" % (meas_freq[j], m, meas_r[j], meas_p[j], i, meas_data[j][1], meas_data[j][2])) j = j + 1 FILE.close() print "Output file " + args.output_file + " written."