Data Buffer
EyeLink data retrieval and buffering.
This module provides the DataBuffer class for managing sample and raw data retrieval and buffering from the EyeLink tracker.
- class pyelink.data.DataBuffer(device, buffer_length=0, use_buffer=False, read_from_tracker_buffer=True, record_raw_data=False)[source]
Bases:
objectHandles data retrieval and buffering from EyeLink tracker.
This class manages: - Sample and raw data retrieval from tracker - Buffering data in a ring buffer - Background threads for continuous data collection
- Parameters:
- __init__(device, buffer_length=0, use_buffer=False, read_from_tracker_buffer=True, record_raw_data=False)[source]
Initialize sample buffer.
- Parameters:
device (
EyeLink) – Connected EyeLink instancebuffer_length (
int) – Number of samples to store in ring buffer (0 = no buffering)use_buffer (
bool) – Store data from tracker buffer in RingBufferread_from_tracker_buffer (
bool) – Use getNextData() instead of getNewestSample() (the former draws from an internal buffer and should miss fewer samples)record_raw_data (
bool) – Whether raw pupil/CR data is being recorded
- Return type:
None
- get_timestamp()[source]
Get timestamp of latest sample.
- Return type:
- Returns:
Timestamp in milliseconds, or np.nan if not connected
- get_sample(write_to_edf=False)[source]
Get the latest gaze sample over the link.
The link must have been activated first: tracker.startRecording(0, 0, 1, 1) If both eyes are used, the left one is chosen by default.
- Eye indices:
0 - left eye 1 - right eye 2 - binocular (returns [lx, ly, lpupil, rx, ry, rpupil])
- get_sample_from_buffer(write_to_edf=False)[source]
Get the latest gaze sample from the EyeLink buffer.
Uses getNextData() which draws from an internal buffer and should miss fewer samples than getNewestSample().
- Data type constants from pylink:
200 - Sample data 4 - ENDBLINK event 8 - ENDFIX event 0x3F/0 - No data available
- get_raw_sample(write_to_edf=False)[source]
Get the latest raw sample over the link.
The link must have been activated first: tracker.startRecording(0, 0, 1, 1)
- get_raw_sample_from_buffer(write_to_edf=False)[source]
Get the latest raw sample from the EyeLink buffer.
- Data type constants from pylink:
200 - Sample data 0x3F/0 - No data available