From 68dd6506fb4650ef115671ed5620d2df8b57deb2 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Wed, 20 May 2020 08:30:10 +0200 Subject: add --histogram option --- bin/msp430-etv | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/bin/msp430-etv b/bin/msp430-etv index d51bacc..5356f01 100755 --- a/bin/msp430-etv +++ b/bin/msp430-etv @@ -106,6 +106,10 @@ OPTIONS Draw power/time plot --stat Print mean voltage, current, and power as well as total energy consumption. + --histogram= + Draw histogram of reported energy values per measurement interval + (i.e., the differences between each pair of consecutive total energy readings) + using buckets. DEPENDENCIES @@ -141,7 +145,7 @@ def peak_search2(data, lower, upper, check_function): if __name__ == '__main__': try: - optspec = ('help load= save= skip= threshold= threshold-peakcount= plot stat') + optspec = ('help load= save= skip= threshold= threshold-peakcount= plot stat histogram=') raw_opts, args = getopt.getopt(sys.argv[1:], "", optspec.split(' ')) for option, parameter in raw_opts: @@ -309,4 +313,10 @@ if __name__ == '__main__': plt.xlabel('Time [s]') plt.ylabel('Power [W]') plt.grid(True) + if 'load' in opt: + plt.title(opt['load']) + plt.show() + + if 'histogram' in opt: + plt.hist((data[1:, 3] - data[:-1, 3]) * 1e-9, bins=int(opt['histogram'])) plt.show() -- cgit v1.2.3