summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <daniel.friesel@uos.de>2020-05-20 08:30:10 +0200
committerDaniel Friesel <daniel.friesel@uos.de>2020-05-20 08:30:10 +0200
commit68dd6506fb4650ef115671ed5620d2df8b57deb2 (patch)
treed93af9e4873f69a74184b7dacd04691d09cbe3b6
parent7f0dd1c826be44e5c03278577c84dad2d2fe5c37 (diff)
add --histogram option
-rwxr-xr-xbin/msp430-etv12
1 files changed, 11 insertions, 1 deletions
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=<n>
+ Draw histogram of reported energy values per measurement interval
+ (i.e., the differences between each pair of consecutive total energy readings)
+ using <n> 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()