summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <daniel.friesel@uos.de>2019-09-27 08:05:31 +0200
committerDaniel Friesel <daniel.friesel@uos.de>2019-09-27 08:05:31 +0200
commitf05f4325b2eb7852c88b5841af6d1adb984e04b9 (patch)
treed156868cb0d4d25c52fbb98211dd38b5552988c5
parentbdd9fa8b2c08c833d398247c4e8fa9806e759c13 (diff)
dfatool RawData v1: Correctly handle repeated measurements
-rwxr-xr-xlib/dfatool.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/dfatool.py b/lib/dfatool.py
index ade685c..e039b92 100755
--- a/lib/dfatool.py
+++ b/lib/dfatool.py
@@ -775,6 +775,7 @@ class RawData:
online_datapoints = []
if 'expected_trace' in measurement:
traces = measurement['expected_trace']
+ traces = self.traces_by_fileno[measurement['fileno']]
else:
traces = self.traces_by_fileno[measurement['fileno']]
for run_idx, run in enumerate(traces):
@@ -929,6 +930,7 @@ class RawData:
elif version == 1:
+ new_filenames = list()
with tarfile.open(filename) as tf:
ptalog = json.load(tf.extractfile(tf.getmember('ptalog.json')))
@@ -941,6 +943,7 @@ class RawData:
# run, ptalog['traces'][0][1] the second, and so on
for j, traces in enumerate(ptalog['traces']):
+ new_filenames.append('{}#{}'.format(filename, j))
self.traces_by_fileno.append(traces)
self.setup_by_fileno.append({
'mimosa_voltage' : ptalog['configs'][j]['voltage'],
@@ -951,11 +954,12 @@ class RawData:
member = tf.getmember(mim_file)
mim_files.append({
'content' : tf.extractfile(member).read(),
- 'fileno' : i,
+ 'fileno' : j,
'info' : member,
'setup' : self.setup_by_fileno[j],
'expected_trace' : ptalog['traces'][j],
})
+ self.filenames = new_filenames
with Pool() as pool:
measurements = pool.map(_preprocess_measurement, mim_files)
@@ -989,6 +993,7 @@ class RawData:
self.traces = self._concatenate_traces(self.traces_by_fileno)
elif version == 1:
self.traces = self._concatenate_traces(map(lambda x: x['expected_trace'], measurements))
+ self.traces = self._concatenate_traces(self.traces_by_fileno)
self.preprocessing_stats = {
'num_runs' : len(measurements),
'num_valid' : num_valid