diff options
author | Daniel Friesel <daniel.friesel@uos.de> | 2020-05-20 08:29:12 +0200 |
---|---|---|
committer | Daniel Friesel <daniel.friesel@uos.de> | 2020-05-20 08:29:48 +0200 |
commit | 7f0dd1c826be44e5c03278577c84dad2d2fe5c37 (patch) | |
tree | 74c0d2743e01ab9d31cadcb6fa4b1be6133f2e1a | |
parent | 3d3b3f9a2040c496da20bc4ab9ed16d3c806b557 (diff) |
fix --stat output
-rwxr-xr-x | bin/msp430-etv | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/bin/msp430-etv b/bin/msp430-etv index 42d15d7..d51bacc 100755 --- a/bin/msp430-etv +++ b/bin/msp430-etv @@ -293,13 +293,13 @@ if __name__ == '__main__': mean_power = running_mean(power_from_energy, 10) if 'stat' in opt: - mean_voltage = np.mean(data[:, 2]) - mean_current = np.mean(data[:, 1]) - mean_power = np.mean(data[:, 1] * data[:, 2]) + mean_voltage = np.mean(data[:, 2] * 1e-3) + mean_current = np.mean(data[:, 1] * 1e-9) + mean_power = np.mean(data[:, 1] * data[:, 2] * 1e-12) print('Mean voltage: {:.2f} V : {:.9f}'.format(mean_voltage, mean_voltage)) print('Mean current: {:.0f} µA : {:.9f}'.format(mean_current * 1e6, mean_current)) print('Mean power: {:.0f} µW : {:.9f}'.format(mean_power * 1e6, mean_power)) - print('Total energy: {:f} J : {:.9f}'.format(m_energy_nj, m_energy_nj)) + print('Total energy: {:f} J : {:.9f}'.format(m_energy_nj * 1e-9, m_energy_nj * 1e-9)) if 'plot' in opt: # nA * mV = pW |