read_eyelink#
- pypillometry.read_eyelink(source, cache_file=None, force_download=False, session=None, cache_dir=None, autodelete=None, cache_layout='flat')[source]#
Read an Eyelink file/URL and return the object returned by the “eyelinkio” package.
Requires the optional package eyelinkio. Its console output is only shown when the log level is “DEBUG”. URLs are downloaded with
fetch_url().- Parameters:
source (
str) – filename of the Eyelink EDF file, HTTP(S) URL (OSF client URLs such ashttps://osf.io/<id>are converted to download URLs) or SSH URL (ssh://server/folder/file.edf)cache_file (
Optional[str]) – local filename to store a downloaded file incache_dir (
Optional[str]) – directory to store a downloaded file in (ascache_dir/<file>, see cache_layout), used if cache_file is None. If both are None, a temporary directory is used.force_download (
bool) – if True, download again even if a local copy exists in cache_file/cache_dirsession (
Optional[Session]) – requests session for HTTP(S) downloads (e.g., fromosf_authenticate()for private projects)autodelete (
Optional[bool]) – if True, the downloaded copy is deleted after it was read (also in cache_file/cache_dir). If None (default), only a temporary download (no cache_file/cache_dir) is deleted. Local files are never deleted.cache_layout (
str) –"flat"(default) or"mirror"(cache_dir/<host>/<path>), seefetch_url()
- Return type:
eyelinkio.EDF
- Returns:
object returned by
eyelinkio.read_edf()
See also
pypillometry.EyeData.from_eyelinkcreate an eyedata object from an EDF file
Notes
Reading EDF files is slow (about a minute for a 90 MB file, mostly in eyelinkio). Convert them once and work with the saved files, which are read in well under a second: with the command-line program
edf2pypilor withwrite_file().