From 69b60f06913dd0d86e4b84938d73840a536d9f57 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Mon, 28 Jan 2019 10:38:04 +0100 Subject: fix mimplot --- bin/mimplot | 2 +- lib/dfatool.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/mimplot b/bin/mimplot index 1768da8..92e1b65 100755 --- a/bin/mimplot +++ b/bin/mimplot @@ -15,7 +15,7 @@ mimfile = sys.argv[3] mim = MIMOSA(voltage, shunt) -charges, triggers = mim.load_data(mimfile) +charges, triggers = mim.load_file(mimfile) charges = charges[:3000000] currents = running_mean(mim.charge_to_current_nocal(charges), 10) * 1e-6 diff --git a/lib/dfatool.py b/lib/dfatool.py index 6be282e..3cc46dc 100755 --- a/lib/dfatool.py +++ b/lib/dfatool.py @@ -1044,6 +1044,10 @@ class MIMOSA: with tarfile.open(fileobj = data_object) as tf: return self._load_tf(tf) + def load_file(self, filename): + with tarfile.open(filename) as tf: + return self._load_tf(tf) + def currents_nocal(self, charges): ua_max = 1.836 / self.shunt * 1000000 ua_step = ua_max / 65535 -- cgit v1.2.3