From aa6b561d239890c81e31c4a3e538f672226f88a5 Mon Sep 17 00:00:00 2001 From: Pablo Prietz Date: Wed, 18 Jul 2018 16:37:20 +0200 Subject: [PATCH] Online Fixation Detector: Replace base data with references Previously, the online fixation detector created a lot of data since it included all gaze data and its corresponding pupil data. This change replaces the gaze data within the `base_data` field with `(topic, timestamp)` tuples which can be used to identify the original gaze data. --- pupil_src/shared_modules/fixation_detector.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pupil_src/shared_modules/fixation_detector.py b/pupil_src/shared_modules/fixation_detector.py index 3221cfe583..595171bef2 100644 --- a/pupil_src/shared_modules/fixation_detector.py +++ b/pupil_src/shared_modules/fixation_detector.py @@ -541,11 +541,16 @@ def recent_events(self, events): new_fixation['id'] = self.id_counter self.id_counter += 1 + self.replace_basedata_with_references(new_fixation) events['fixations'].append(new_fixation) self.recent_fixation = new_fixation else: self.recent_fixation = None + def replace_basedata_with_references(self, fixation): + fixation['base_data'] = [(gaze['topic'], gaze['timestamp']) + for gaze in fixation['base_data']] + def gl_display(self): if self.recent_fixation: fs = self.g_pool.capture.frame_size # frame height