diff options
author | jfalkenhagen <jfalkenhagen@uos.de> | 2020-07-16 16:39:19 +0200 |
---|---|---|
committer | jfalkenhagen <jfalkenhagen@uos.de> | 2020-07-16 16:39:19 +0200 |
commit | 98d23807e35cc211415c7e0c887f1b1b502f10e5 (patch) | |
tree | ebb649c585166e546dda704990ed4c5eeb95519f /bin/gradient | |
parent | a00ffc0e32ddc72a8faceec4344432cdbf3b90c7 (diff) | |
parent | af4cc108b5c5132a991a2b83d258ed55e985936f (diff) |
Merge branch 'master' into janis
Diffstat (limited to 'bin/gradient')
-rwxr-xr-x | bin/gradient | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/bin/gradient b/bin/gradient index 8280794..ca60949 100755 --- a/bin/gradient +++ b/bin/gradient @@ -7,7 +7,7 @@ import struct import sys import tarfile import matplotlib.pyplot as plt -from dfatool.dfatool import MIMOSA +from dfatool.loader import MIMOSA from dfatool.utils import running_mean voltage = float(sys.argv[1]) @@ -17,17 +17,17 @@ mimfile = sys.argv[3] mim = MIMOSA(voltage, shunt) charges, triggers = mim.load_file(mimfile) -#charges = charges[2000000:3000000] +# charges = charges[2000000:3000000] currents = running_mean(mim.charge_to_current_nocal(charges), 10) * 1e-6 xr = np.arange(len(currents)) * 1e-5 threshold = 1e-5 grad = np.gradient(currents, 2) tp = np.abs(grad) > threshold -plt.plot( xr, currents, "r-") -plt.plot( xr, grad, "y-") -plt.plot( xr[tp], grad[tp], "bo") -plt.xlabel('Zeit [s]') -plt.ylabel('Strom [A]') +plt.plot(xr, currents, "r-") +plt.plot(xr, grad, "y-") +plt.plot(xr[tp], grad[tp], "bo") +plt.xlabel("Zeit [s]") +plt.ylabel("Strom [A]") plt.grid(True) plt.show() |