From 4f763f85e9f572b56e3465ccd47641c71cdb8bbf Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Mon, 8 Mar 2021 14:20:42 +0100 Subject: add dataref export --- lib/loader.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lib/loader.py') 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": -- cgit v1.2.3