def parse_phase(self, l): if self.current_phase in ('cue', 'retention', 'preAttProbe') \ or 'cue' in l or 'retention' in l or 'preAttProbe' in l: s = sample(l) if s is None or s.t % DOWNSAMPLE == 0: EyeLinkParser.parse_phase(self, l)
def parse_phase(self, l): # For performance only check for start- and end-phase messages if there # actually is a message if l[0] == 'MSG': if self.match(l, u'MSG', int, (u'start_phase', u'phase'), basestring): self.start_phase(l) return if self.match(l, u'MSG', int, (u'end_phase', u'stop_phase'), basestring): if self.current_phase != l[3]: warnings.warn(u'Trace %s was ended while current phase was %s' \ % (l[3], self.current_phase)) return self.end_phase(l) return if self.current_phase is None: return s = sample(l) if s is not None: self.parse_sample(s) return f = fixation(l) if f is not None: self.parse_fixation(f)
def parse_phase(self, l): if self.match(l, u'MSG', int, (u'start_phase', u'phase'), basestring): self.start_phase(l) return if self.match(l, u'MSG', int, (u'end_phase', u'stop_phase'), basestring): assert(self.current_phase == l[3]) self.end_phase() return if self.current_phase is None: return s = sample(l) if s is None: return if self._downsample is not None and self._lastsampletime is not None \ and s.t - self._lastsampletime < self._downsample: return self._lastsampletime = s.t self.ttrace.append(s.t) self.ptrace.append(s.pupil_size) self.xtrace.append(s.x) self.ytrace.append(s.y)