pymovements.gaze.from_asc#
- pymovements.gaze.from_asc(file: str | Path, *, patterns: str | list | None = 'eyelink', schema: dict[str, Any] | None = None, experiment: Experiment | None = None, add_columns: dict[str, str] | None = None, column_dtypes: dict[str, Any] | None = None) GazeDataFrame #
Initialize a
pymovements.gaze.gaze_dataframe.GazeDataFrame
.- Parameters:
file (str | Path) – Path of IPC/feather file.
patterns (str | list | None) – list of patterns to match for additional columns or a key identifier of eye tracker specific default patterns. Supported values are: eyelink. (default: ‘eyelink’)
schema (dict[str, Any] | None) – Dictionary to optionally specify types of columns parsed by patterns. (default: None)
experiment (Experiment | None) – The experiment definition. (default: None)
add_columns (dict[str, str] | None) – Dictionary containing columns to add to loaded data frame. (default: None)
column_dtypes (dict[str, Any] | None) – Dictionary containing types for columns. (default: None)
- Returns:
The gaze data frame read from the asc file.
- Return type:
Examples
Let’s assume we have an EyeLink asc file stored at tests/files/eyelink_monocular_example.asc. We can then load the data into a
GazeDataFrame
:>>> from pymovements.gaze.io import from_asc >>> gaze = from_asc(file='tests/files/eyelink_monocular_example.asc', patterns='eyelink') >>> gaze.frame shape: (16, 3) ┌─────────┬───────┬────────────────┐ │ time ┆ pupil ┆ pixel │ │ --- ┆ --- ┆ --- │ │ i64 ┆ f64 ┆ list[f64] │ ╞═════════╪═══════╪════════════════╡ │ 2154556 ┆ 778.0 ┆ [138.1, 132.8] │ │ 2154557 ┆ 778.0 ┆ [138.2, 132.7] │ │ 2154560 ┆ 777.0 ┆ [137.9, 131.6] │ │ 2154564 ┆ 778.0 ┆ [138.1, 131.0] │ │ … ┆ … ┆ … │ │ 2339271 ┆ 617.0 ┆ [639.4, 531.9] │ │ 2339272 ┆ 617.0 ┆ [639.0, 531.9] │ │ 2339290 ┆ 618.0 ┆ [637.6, 531.4] │ │ 2339291 ┆ 618.0 ┆ [637.3, 531.2] │ └─────────┴───────┴────────────────┘