diff options
author | Daniel Friesel <daniel.friesel@uos.de> | 2021-04-20 11:55:33 +0200 |
---|---|---|
committer | Daniel Friesel <daniel.friesel@uos.de> | 2021-04-20 11:55:33 +0200 |
commit | af877114a3e4324e2de36008ccfd87c54dd6b32b (patch) | |
tree | 461d8f483a3279603565479bbeb558798b362019 | |
parent | 5b43e9b07d48bb65771a66760128fc85afc1b95e (diff) |
loader: define maximum sync pulse duration
-rw-r--r-- | lib/loader/energytrace.py | 2 | ||||
-rw-r--r-- | lib/loader/generic.py | 8 | ||||
-rw-r--r-- | lib/loader/keysight.py | 1 |
3 files changed, 9 insertions, 2 deletions
diff --git a/lib/loader/energytrace.py b/lib/loader/energytrace.py index 0386b99..9d13819 100644 --- a/lib/loader/energytrace.py +++ b/lib/loader/energytrace.py @@ -651,6 +651,7 @@ class EnergyTraceWithLogicAnalyzer(ExternalTimerSync): self.errors = list() self.sync_min_duration = 0.7 + self.sync_max_duration = 1.3 self.sync_min_low_count = 3 self.sync_min_high_count = 1 self.sync_power = 0.011 @@ -723,6 +724,7 @@ class EnergyTraceWithTimer(ExternalTimerSync): self.errors = list() self.sync_min_duration = 0.7 + self.sync_max_duration = 1.3 self.sync_min_low_count = 3 self.sync_min_high_count = 1 self.sync_power = 0.011 diff --git a/lib/loader/generic.py b/lib/loader/generic.py index 67535bc..22fb5d9 100644 --- a/lib/loader/generic.py +++ b/lib/loader/generic.py @@ -50,7 +50,7 @@ class ExternalTimerSync: # * self.data (e.g. power readings) # * self.timestamps (timstamps in seconds) # * self.sync_min_high_count, self.sync_min_low_count: outlier handling in synchronization pulse detection - # * self.sync_power, self.sync_min_duration: synchronization pulse parameters. one pulse before the measurement, two pulses afterwards + # * self.sync_power, self.sync_min_duration, self.sync_max_duration: synchronization pulse parameters. one pulse before the measurement, two pulses afterwards # expected_trace must contain online timestamps # TODO automatically determine sync_power if it is None def analyze_states(self, expected_trace, repeat_id, online_timestamps=None): @@ -79,7 +79,11 @@ class ExternalTimerSync: if high_count >= self.sync_min_high_count and sync_start is None: sync_start = high_ts elif low_count >= self.sync_min_low_count and sync_start is not None: - if low_ts - sync_start > self.sync_min_duration: + if ( + self.sync_min_duration + < low_ts - sync_start + < self.sync_max_duration + ): sync_end = low_ts sync_timestamps.append((sync_start, sync_end)) sync_start = None diff --git a/lib/loader/keysight.py b/lib/loader/keysight.py index 98d09b4..5825049 100644 --- a/lib/loader/keysight.py +++ b/lib/loader/keysight.py @@ -82,6 +82,7 @@ class DLog(ExternalTimerSync): self.errors = list() self.sync_min_duration = 0.7 + self.sync_max_duration = 1.3 self.sync_min_low_count = 3 self.sync_min_high_count = 3 |