From 8b397c0728cc270ecb53b2dee2b2d4f0e261283e Mon Sep 17 00:00:00 2001 From: Harry Ho Date: Wed, 6 Oct 2021 12:26:20 +0800 Subject: [PATCH] plot_sayma_data: Add option to skip data plotting --- plot_sayma_data.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/plot_sayma_data.py b/plot_sayma_data.py index 3f4c38c..96586c0 100644 --- a/plot_sayma_data.py +++ b/plot_sayma_data.py @@ -31,6 +31,9 @@ def main(): parser.add_argument("--log", help="path of the log file where the measurement record will be appended", type=str) + parser.add_argument("--noplot", + help="do not show data plot, which is blocking until the GUI is closed", + action="store_true") args = parser.parse_args() # Must only compare 2 data @@ -77,12 +80,13 @@ def main(): # Print the phase difference print(angle) - # Normalize y1 and y2 for plotting - y1 /= abs(y1).max() - y2 /= abs(y2).max() - plot.plot(y1) - plot.plot(y2) - plot.show() + if not args.noplot: + # Normalize y1 and y2 for plotting + y1 /= abs(y1).max() + y2 /= abs(y2).max() + plot.plot(y1) + plot.plot(y2) + plot.show() if __name__ == "__main__": main()