From 07740687927b803d8a005304b0ec26c3bd20f104 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Tue, 15 Dec 2020 12:18:49 +0100 Subject: dataprocessor: export drift compensation data --- lib/lennart/DataProcessor.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'lib/lennart') 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): -- cgit v1.2.3