eyelinkparser


Nameeyelinkparser JSON
Version 0.17.5 PyPI version JSON
download
home_page
SummaryThis file is part of eyelinkparser.
upload_time2023-10-06 11:37:58
maintainer
docs_urlNone
author
requires_python>=3.7
license
keywords data analysis eye tracking eyelink
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Python EyeLinkParser

Sebastiaan Mathôt and contributors <br />
Copyright 2016-2023  <br />
http://www.cogsci.nl/smathot

## About

The `python-eyelinkparser` module provides a framework to parse EyeLink data files in `.asc` format, that is, the format that you get after converting an `.edf` file with `edf2asc`. This module is mostly for personal use, and is not very well documented.

## Installation

```
pip install eyelinkparser
```

## Expected format

The parser assumes monocular recording.


## Expected messages

By default, the parser assumes that particular messages are sent to the logfile. If you use different messages, you need to override functions in `_eyelinkparser.EyeLinkParser`. This is not explained here, but you can look in the source code to see how it works.

Trial start:

	start_trial [trialid]
	
Trial end:

	end_trial
	stop_trial
	
Variables:

	var [name] [value]
	
Start of a period of continuous data:
	
	start_phase [name]
	phase [name]
	
End of a period of continuous data:

	end_phase [name]
	stop_phase [name]
	
	

## Function reference

## <span style="color:purple">eyelinkparser.EyeLinkParser</span>_(folder='data', ext=('.asc', '.edf', '.tar.xz'), downsample=None, maxtracelen=None, traceprocessor=None, phasefilter=None, phasemap={}, trialphase=None, edf2asc\_binary='edf2asc', multiprocess=False, asc\_encoding=None, pupil\_size=True, gaze\_pos=True, time\_trace=True)_

The main parser class. This is generally not created directly, but
through the `eyelinkparser.parse()` function, which takes the same keywords
as the `EyeLinkParser` constructor (i.e. the keywords below).

### Parameters

* **folder: str, optional**

  The folder that contains .edf or .asc data files, or files compressed
  as .tar.xz archives.

* **ext: str or tuple, optional**

  Allowed file extensions, or a tuple of extensions, for data files.

* **downsample: int or None, optional**

  Indicates whether traces (if any) should be downsampled. For example, a
  value of 10 means that the signal becomes 10 times shorter. Downsample
  creates a simple traceprocessor, and can therefore not be used in
  combination with the traceprocessor argument.

* **maxtracelen: int or None, optional**

  A maximum length for traces. Longer traces are truncated and a
  `UserWarning` is emitted. This length refers to the trace after
  downsampling/ processing.

* **traceprocessor: callable or None, optional**

  A function that is applied to each trace before the trace is written to
  the SeriesColumn. This can be used to apply a series of operations that
  are best done on the raw signal, such as first correcting blinks and
  then downsampling the signal.

  The function must accept two arguments: first a label for the trace,
  which is 'pupil', 'xcoor', 'ycoor', or 'time'. This allows the function
  to distinguish the different kinds of singals; second, the trace
  itself.

  See `eyelinkparser.defaulttraceprocessor` for a convenience function
  that applies blink correction and downsampling.

* **trialphase: str or None, optional**

  Indicates the name of a phase that should be automatically started when
  the trial starts, or `None` when no trial should be automatically
  started. This is mostly convenient for processing trials that consist
  of a single long epoch, or when no `start_phase` messages were written
  to the log file.

* **phasefilter: callable or None, optional**

  A function that receives a phase name as argument, and returns a bool
  indicating whether that phase should be retained.

* **phasemap: dict, optional**

  A dict in which keys are phase names that are renamed to the associated
  values. This is mostly useful to merge subsequent traces, in which
  case the key is the first trace and the value is the second trace.

* **edf2asc\_binary: str, optional**

  The name of the edf2asc executable, which if available can be used to
  automatically convert .edf files to .asc. If not available, the parser
  can only parse .asc files.

* **multiprocess: bool or int, optional**

  Indicates whether each file should be processed in a different process.
  This can speed up parsing considerably. If not `False`, this should be
  an int to indicate the number of processes.

* **asc\_encoding: str or None, optional**

  Indicates the character encoding of the `.asc` files, or `None` to use
  system default.

* **pupil\_size: bool, optional**

  Indicates whether pupil-size traces should be stored. If enabled, pupil
  size is stored as `ptrace_[phase]` columns.

* **gaze\_pos: bool, optional**

  Indicates whether horizontal and vertical gaze-position traces should
  be stored. If enabled, gaze position is stored as `xtrace_[phase]` and
  `ytrace_[phase]` columns.

* **time\_trace: bool, optional**

  Indicates whether timestamp traces should be stored, which indicate the
  timestamps of the corresponding pupil and gaze-position traces. If
  enabled, timestamps are stored as `ptrace_[phase]` columns.

### Examples

```python
import eyelinkparser as ep
dm = ep.parse(defaulttraceprocessor=ep.defaulttraceprocessor(
    blinkreconstruct=True, downsample=True, mode='advanced'))
```


## Tutorial

For a tutorial about using EyeLinkParser, see:

- <https://pydatamatrix.eu/eyelinkparser/>

## License

`python-eyelinkparser` is licensed under the [GNU General Public License
v3](http://www.gnu.org/licenses/gpl-3.0.en.html).


            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "eyelinkparser",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "data analysis,eye tracking,eyelink",
    "author": "",
    "author_email": "Sebastiaan Math\u00f4t <s.mathot@cogsci.nl>",
    "download_url": "https://files.pythonhosted.org/packages/25/cc/7b12a30405163f3dfacc43b154461895f8832b67650b3fbc2d65cf2451bc/eyelinkparser-0.17.5.tar.gz",
    "platform": null,
    "description": "# Python EyeLinkParser\n\nSebastiaan Math\u00f4t and contributors <br />\nCopyright 2016-2023  <br />\nhttp://www.cogsci.nl/smathot\n\n## About\n\nThe `python-eyelinkparser` module provides a framework to parse EyeLink data files in `.asc` format, that is, the format that you get after converting an `.edf` file with `edf2asc`. This module is mostly for personal use, and is not very well documented.\n\n## Installation\n\n```\npip install eyelinkparser\n```\n\n## Expected format\n\nThe parser assumes monocular recording.\n\n\n## Expected messages\n\nBy default, the parser assumes that particular messages are sent to the logfile. If you use different messages, you need to override functions in `_eyelinkparser.EyeLinkParser`. This is not explained here, but you can look in the source code to see how it works.\n\nTrial start:\n\n\tstart_trial [trialid]\n\t\nTrial end:\n\n\tend_trial\n\tstop_trial\n\t\nVariables:\n\n\tvar [name] [value]\n\t\nStart of a period of continuous data:\n\t\n\tstart_phase [name]\n\tphase [name]\n\t\nEnd of a period of continuous data:\n\n\tend_phase [name]\n\tstop_phase [name]\n\t\n\t\n\n## Function reference\n\n## <span style=\"color:purple\">eyelinkparser.EyeLinkParser</span>_(folder='data', ext=('.asc', '.edf', '.tar.xz'), downsample=None, maxtracelen=None, traceprocessor=None, phasefilter=None, phasemap={}, trialphase=None, edf2asc\\_binary='edf2asc', multiprocess=False, asc\\_encoding=None, pupil\\_size=True, gaze\\_pos=True, time\\_trace=True)_\n\nThe main parser class. This is generally not created directly, but\nthrough the `eyelinkparser.parse()` function, which takes the same keywords\nas the `EyeLinkParser` constructor (i.e. the keywords below).\n\n### Parameters\n\n* **folder: str, optional**\n\n  The folder that contains .edf or .asc data files, or files compressed\n  as .tar.xz archives.\n\n* **ext: str or tuple, optional**\n\n  Allowed file extensions, or a tuple of extensions, for data files.\n\n* **downsample: int or None, optional**\n\n  Indicates whether traces (if any) should be downsampled. For example, a\n  value of 10 means that the signal becomes 10 times shorter. Downsample\n  creates a simple traceprocessor, and can therefore not be used in\n  combination with the traceprocessor argument.\n\n* **maxtracelen: int or None, optional**\n\n  A maximum length for traces. Longer traces are truncated and a\n  `UserWarning` is emitted. This length refers to the trace after\n  downsampling/ processing.\n\n* **traceprocessor: callable or None, optional**\n\n  A function that is applied to each trace before the trace is written to\n  the SeriesColumn. This can be used to apply a series of operations that\n  are best done on the raw signal, such as first correcting blinks and\n  then downsampling the signal.\n\n  The function must accept two arguments: first a label for the trace,\n  which is 'pupil', 'xcoor', 'ycoor', or 'time'. This allows the function\n  to distinguish the different kinds of singals; second, the trace\n  itself.\n\n  See `eyelinkparser.defaulttraceprocessor` for a convenience function\n  that applies blink correction and downsampling.\n\n* **trialphase: str or None, optional**\n\n  Indicates the name of a phase that should be automatically started when\n  the trial starts, or `None` when no trial should be automatically\n  started. This is mostly convenient for processing trials that consist\n  of a single long epoch, or when no `start_phase` messages were written\n  to the log file.\n\n* **phasefilter: callable or None, optional**\n\n  A function that receives a phase name as argument, and returns a bool\n  indicating whether that phase should be retained.\n\n* **phasemap: dict, optional**\n\n  A dict in which keys are phase names that are renamed to the associated\n  values. This is mostly useful to merge subsequent traces, in which\n  case the key is the first trace and the value is the second trace.\n\n* **edf2asc\\_binary: str, optional**\n\n  The name of the edf2asc executable, which if available can be used to\n  automatically convert .edf files to .asc. If not available, the parser\n  can only parse .asc files.\n\n* **multiprocess: bool or int, optional**\n\n  Indicates whether each file should be processed in a different process.\n  This can speed up parsing considerably. If not `False`, this should be\n  an int to indicate the number of processes.\n\n* **asc\\_encoding: str or None, optional**\n\n  Indicates the character encoding of the `.asc` files, or `None` to use\n  system default.\n\n* **pupil\\_size: bool, optional**\n\n  Indicates whether pupil-size traces should be stored. If enabled, pupil\n  size is stored as `ptrace_[phase]` columns.\n\n* **gaze\\_pos: bool, optional**\n\n  Indicates whether horizontal and vertical gaze-position traces should\n  be stored. If enabled, gaze position is stored as `xtrace_[phase]` and\n  `ytrace_[phase]` columns.\n\n* **time\\_trace: bool, optional**\n\n  Indicates whether timestamp traces should be stored, which indicate the\n  timestamps of the corresponding pupil and gaze-position traces. If\n  enabled, timestamps are stored as `ptrace_[phase]` columns.\n\n### Examples\n\n```python\nimport eyelinkparser as ep\ndm = ep.parse(defaulttraceprocessor=ep.defaulttraceprocessor(\n    blinkreconstruct=True, downsample=True, mode='advanced'))\n```\n\n\n## Tutorial\n\nFor a tutorial about using EyeLinkParser, see:\n\n- <https://pydatamatrix.eu/eyelinkparser/>\n\n## License\n\n`python-eyelinkparser` is licensed under the [GNU General Public License\nv3](http://www.gnu.org/licenses/gpl-3.0.en.html).\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "This file is part of eyelinkparser.",
    "version": "0.17.5",
    "project_urls": {
        "Documentation": "https://github.com/open-cogsci/eyelinkparser",
        "Source": "https://github.com/open-cogsci/eyelinkparser"
    },
    "split_keywords": [
        "data analysis",
        "eye tracking",
        "eyelink"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6688017137390e8812bdc1393c8a80ddfb746962084cb8ac2d459af43585dbe2",
                "md5": "02d1090aa8994deca19c812e35f42e0b",
                "sha256": "46b14d708b1b5fddc7fd9ef2bd7263e06e940ac9b03ae911dea8689adf97de3f"
            },
            "downloads": -1,
            "filename": "eyelinkparser-0.17.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "02d1090aa8994deca19c812e35f42e0b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 27176,
            "upload_time": "2023-10-06T11:37:57",
            "upload_time_iso_8601": "2023-10-06T11:37:57.047464Z",
            "url": "https://files.pythonhosted.org/packages/66/88/017137390e8812bdc1393c8a80ddfb746962084cb8ac2d459af43585dbe2/eyelinkparser-0.17.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "25cc7b12a30405163f3dfacc43b154461895f8832b67650b3fbc2d65cf2451bc",
                "md5": "d9cd9a9c3ec8a033d4b7f117d89c4dbb",
                "sha256": "f5bf58996a1a1bc1a794d413ebef1b92ba44191e1ba11ac37c66d8d514ba93e5"
            },
            "downloads": -1,
            "filename": "eyelinkparser-0.17.5.tar.gz",
            "has_sig": false,
            "md5_digest": "d9cd9a9c3ec8a033d4b7f117d89c4dbb",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 23447,
            "upload_time": "2023-10-06T11:37:58",
            "upload_time_iso_8601": "2023-10-06T11:37:58.021782Z",
            "url": "https://files.pythonhosted.org/packages/25/cc/7b12a30405163f3dfacc43b154461895f8832b67650b3fbc2d65cf2451bc/eyelinkparser-0.17.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-10-06 11:37:58",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "open-cogsci",
    "github_project": "eyelinkparser",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "eyelinkparser"
}
        
Elapsed time: 3.28029s