summaryrefslogtreecommitdiff
path: root/bin/analyze.py
diff options
context:
space:
mode:
Diffstat (limited to 'bin/analyze.py')
-rwxr-xr-xbin/analyze.py40
1 files changed, 0 insertions, 40 deletions
diff --git a/bin/analyze.py b/bin/analyze.py
deleted file mode 100755
index 57803fe..0000000
--- a/bin/analyze.py
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/usr/bin/env python3
-
-import json
-import numpy as np
-import os
-from scipy.cluster.vq import kmeans2
-import struct
-import sys
-import tarfile
-from dfatool import running_mean, MIMOSA
-
-voltage = float(sys.argv[1])
-shunt = float(sys.argv[2])
-filename = sys.argv[3]
-
-mim = MIMOSA(voltage, shunt)
-
-charges, triggers = mim.load_data(filename)
-trigidx = mim.trigger_edges(triggers)
-triggers = []
-cal_edges = mim.calibration_edges(running_mean(mim.currents_nocal(charges[0:trigidx[0]]), 10))
-calfunc, caldata = mim.calibration_function(charges, cal_edges)
-vcalfunc = np.vectorize(calfunc, otypes=[np.float64])
-
-json_out = {
- 'triggers' : len(trigidx),
- 'first_trig' : trigidx[0] * 10,
- 'calibration' : caldata,
- 'trace' : mim.analyze_states(charges, trigidx, vcalfunc)
-}
-
-basename, _ = os.path.splitext(filename)
-
-# TODO also look for interesting gradients inside each state
-
-with open(basename + ".json", "w") as f:
- json.dump(json_out, f)
- f.close()
-
-#print(kmeans2(charges[:firstidx], np.array([130 * ua_step, 3.6 / 987 * 1000000, 3.6 / 99300 * 1000000])))