From b4436b06e7979d4b4a5a8363f0e8fc51d705333b Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Wed, 20 May 2020 08:38:34 +0200 Subject: --histogram: Add duration and power plots --- bin/msp430-etv | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/bin/msp430-etv b/bin/msp430-etv index 624f91f..1f9ecea 100755 --- a/bin/msp430-etv +++ b/bin/msp430-etv @@ -117,9 +117,12 @@ OPTIONS --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. + Draw histograms of reported energy values per measurement interval + (i.e., the differences between each pair of consecutive total energy readings), + measurement interval duration, and + mean power values per measurement interval + (calculated from energy difference and duration). + Each histogram uses buckets. DEPENDENCIES @@ -385,5 +388,19 @@ if __name__ == "__main__": plt.show() if "histogram" in opt: - plt.hist((data[1:, 3] - data[:-1, 3]) * 1e-9, bins=int(opt["histogram"])) + bin_count = int(opt["histogram"]) + + plt.xlabel("Reported Energy per Measurement Interval [J]") + plt.ylabel("Count") + plt.hist((data[1:, 3] - data[:-1, 3]) * 1e-9, bins=bin_count) + plt.show() + + plt.xlabel("Measurement Interval Duration [s]") + plt.ylabel("Count") + plt.hist((data[1:, 0] - data[:-1, 0]) * 1e-6, bins=bin_count) + plt.show() + + plt.xlabel("Mean Power per Measurement Interval [W]") + plt.ylabel("Count") + plt.hist(power_from_energy, bins=bin_count) plt.show() -- cgit v1.2.3