summaryrefslogtreecommitdiff
path: root/lib/lennart
diff options
context:
space:
mode:
authorDaniel Friesel <daniel.friesel@uos.de>2020-12-15 12:18:49 +0100
committerDaniel Friesel <daniel.friesel@uos.de>2020-12-15 12:18:49 +0100
commit07740687927b803d8a005304b0ec26c3bd20f104 (patch)
treea384ea62f809b243ac249302d3d312057f524ce5 /lib/lennart
parent7d319d3c87de653fb9c4d788e17f8c134820171f (diff)
dataprocessor: export drift compensation data
Diffstat (limited to 'lib/lennart')
-rw-r--r--lib/lennart/DataProcessor.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/lennart/DataProcessor.py b/lib/lennart/DataProcessor.py
index 44d8187..dd45996 100644
--- a/lib/lennart/DataProcessor.py
+++ b/lib/lennart/DataProcessor.py
@@ -272,6 +272,20 @@ class DataProcessor:
# TODO calculate drift for "None" timestamps based on the previous and next known drift value
+ if os.getenv("DFATOOL_EXPORT_DRIFT_COMPENSATION"):
+ import json
+ from dfatool.utils import NpEncoder
+
+ with open(os.getenv("DFATOOL_EXPORT_DRIFT_COMPENSATION"), "w") as f:
+ json.dump(
+ [
+ expected_transition_start_timestamps,
+ transition_start_candidate_weights,
+ ],
+ f,
+ cls=NpEncoder,
+ )
+
return compensated_timestamps
def export_sync(self):