summaryrefslogtreecommitdiff
path: root/lib/loader.py
diff options
context:
space:
mode:
authorDaniel Friesel <daniel.friesel@uos.de>2021-03-08 14:20:42 +0100
committerDaniel Friesel <daniel.friesel@uos.de>2021-03-08 14:20:42 +0100
commit4f763f85e9f572b56e3465ccd47641c71cdb8bbf (patch)
treeafe598fa0c21876047ef4d3517d1835084b48763 /lib/loader.py
parent3865ca8f08181fa18d14aa924a0a1388cd5f54ee (diff)
add dataref export
Diffstat (limited to 'lib/loader.py')
-rw-r--r--lib/loader.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/loader.py b/lib/loader.py
index c0aa105..f5c6306 100644
--- a/lib/loader.py
+++ b/lib/loader.py
@@ -372,6 +372,16 @@ class RawData:
}
json.dump(cache_data, f)
+ def to_dref(self) -> dict:
+ return {
+ "raw measurements/valid": self.preprocessing_stats["num_valid"],
+ "raw measurements/total": self.preprocessing_stats["num_runs"],
+ "static state duration/mean": (
+ np.mean(list(map(lambda x: x["state_duration"], self.setup_by_fileno))),
+ r"\milli\second",
+ ),
+ }
+
def _state_is_too_short(self, online, offline, state_duration, next_transition):
# We cannot control when an interrupt causes a state to be left
if next_transition["plan"]["level"] == "epilogue":