summaryrefslogtreecommitdiff
path: root/bin/gradient
diff options
context:
space:
mode:
authorDaniel Friesel <daniel.friesel@uos.de>2020-07-06 15:32:32 +0200
committerDaniel Friesel <daniel.friesel@uos.de>2020-07-06 15:32:32 +0200
commit9bed652910dfd3da3949d63a87b73614a9fd4bbc (patch)
treefc647cca4eb04185bf8f05466d4941f82b53627f /bin/gradient
parent92030c19d7cde49999648509309c3ac6e8b4ba21 (diff)
blacken more code
Diffstat (limited to 'bin/gradient')
-rwxr-xr-xbin/gradient12
1 files changed, 6 insertions, 6 deletions
diff --git a/bin/gradient b/bin/gradient
index 0409c38..ca60949 100755
--- a/bin/gradient
+++ b/bin/gradient
@@ -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()