{ "cells": [ { "cell_type": "markdown", "id": "fc368b25", "metadata": {}, "source": [ "# Importing data from Eyelink EDF files" ] }, { "cell_type": "code", "execution_count": 1, "id": "e588b4bb", "metadata": { "execution": { "iopub.execute_input": "2026-11-10T13:36:36.573964Z", "iopub.status.busy": "2026-11-10T13:36:36.573792Z", "iopub.status.idle": "2026-11-10T13:36:37.131945Z", "shell.execute_reply": "2026-11-10T13:36:37.130808Z" } }, "outputs": [], "source": [ "import pypillometry as pp\n", "from pypillometry import u\n", "import matplotlib.pyplot as plt" ] }, { "cell_type": "markdown", "id": "ce430b1e", "metadata": {}, "source": [ "The easiest way is to use a local filename or a URL where the EDF file is stored:" ] }, { "cell_type": "code", "execution_count": 2, "id": "1d126833", "metadata": { "execution": { "iopub.execute_input": "2026-11-10T13:36:37.134639Z", "iopub.status.busy": "2026-11-10T13:36:37.134296Z", "iopub.status.idle": "2026-11-10T13:36:49.020368Z", "shell.execute_reply": "2026-11-10T13:36:49.019246Z" } }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "\u001b[32mpp: 14:36:37\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mfetch_url\u001b[0m:\u001b[36m462\u001b[0m | \u001b[1mDownloading 'https://osf.io/trsuq/download' to /tmp/pypillometry_80ga7xxe/download\u001b[0m\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "\r", "download: 0%| | 0.00/14.2M [00:00, ?iB/s]" ] }, { "name": "stderr", "output_type": "stream", "text": [ "\r", "download: 1%| | 111k/14.2M [00:00<00:18, 810kiB/s]" ] }, { "name": "stderr", "output_type": "stream", "text": [ "\r", "download: 2%|▏ | 305k/14.2M [00:00<00:10, 1.35MiB/s]" ] }, { "name": "stderr", "output_type": "stream", "text": [ "\r", "download: 4%|▎ | 513k/14.2M [00:00<00:08, 1.66MiB/s]" ] }, { "name": "stderr", "output_type": "stream", "text": [ "\r", "download: 5%|▌ | 737k/14.2M [00:00<00:07, 1.86MiB/s]" ] }, { "name": "stderr", "output_type": "stream", "text": [ "\r", "download: 7%|▋ | 993k/14.2M [00:00<00:06, 2.11MiB/s]" ] }, { "name": "stderr", "output_type": "stream", "text": [ "\r", "download: 9%|▉ | 1.25M/14.2M [00:00<00:05, 2.33MiB/s]" ] }, { "name": "stderr", "output_type": "stream", "text": [ "\r", "download: 11%|█ | 1.56M/14.2M [00:00<00:05, 2.60MiB/s]" ] }, { "name": "stderr", "output_type": "stream", "text": [ "\r", "download: 13%|█▎ | 1.91M/14.2M [00:00<00:04, 2.90MiB/s]" ] }, { "name": "stderr", "output_type": "stream", "text": [ "\r", "download: 16%|█▌ | 2.28M/14.2M [00:00<00:03, 3.14MiB/s]" ] }, { "name": "stderr", "output_type": "stream", "text": [ "\r", "download: 19%|█▉ | 2.70M/14.2M [00:01<00:03, 3.34MiB/s]" ] }, { "name": "stderr", "output_type": "stream", "text": [ "\r", "download: 22%|██▏ | 3.17M/14.2M [00:01<00:03, 3.65MiB/s]" ] }, { "name": "stderr", "output_type": "stream", "text": [ "\r", "download: 26%|██▌ | 3.69M/14.2M [00:01<00:02, 4.05MiB/s]" ] }, { "name": "stderr", "output_type": "stream", "text": [ "\r", "download: 30%|██▉ | 4.25M/14.2M [00:01<00:02, 4.53MiB/s]" ] }, { "name": "stderr", "output_type": "stream", "text": [ "\r", "download: 33%|███▎ | 4.75M/14.2M [00:01<00:02, 4.69MiB/s]" ] }, { "name": "stderr", "output_type": "stream", "text": [ "\r", "download: 37%|███▋ | 5.28M/14.2M [00:01<00:01, 4.92MiB/s]" ] }, { "name": "stderr", "output_type": "stream", "text": [ "\r", "download: 42%|████▏ | 6.02M/14.2M [00:01<00:01, 5.55MiB/s]" ] }, { "name": "stderr", "output_type": "stream", "text": [ "\r", "download: 47%|████▋ | 6.64M/14.2M [00:01<00:01, 5.84MiB/s]" ] }, { "name": "stderr", "output_type": "stream", "text": [ "\r", "download: 52%|█████▏ | 7.41M/14.2M [00:01<00:01, 6.38MiB/s]" ] }, { "name": "stderr", "output_type": "stream", "text": [ "\r", "download: 58%|█████▊ | 8.22M/14.2M [00:02<00:00, 6.97MiB/s]" ] }, { "name": "stderr", "output_type": "stream", "text": [ "\r", "download: 63%|██████▎ | 8.98M/14.2M [00:02<00:00, 7.27MiB/s]" ] }, { "name": "stderr", "output_type": "stream", "text": [ "\r", "download: 69%|██████▉ | 9.83M/14.2M [00:02<00:00, 7.72MiB/s]" ] }, { "name": "stderr", "output_type": "stream", "text": [ "\r", "download: 74%|███████▍ | 10.6M/14.2M [00:02<00:00, 7.69MiB/s]" ] }, { "name": "stderr", "output_type": "stream", "text": [ "\r", "download: 80%|███████▉ | 11.4M/14.2M [00:02<00:00, 7.43MiB/s]" ] }, { "name": "stderr", "output_type": "stream", "text": [ "\r", "download: 85%|████████▍ | 12.1M/14.2M [00:02<00:00, 7.39MiB/s]" ] }, { "name": "stderr", "output_type": "stream", "text": [ "\r", "download: 90%|████████▉ | 12.8M/14.2M [00:02<00:00, 7.38MiB/s]" ] }, { "name": "stderr", "output_type": "stream", "text": [ "\r", "download: 96%|█████████▌| 13.6M/14.2M [00:02<00:00, 7.73MiB/s]" ] }, { "name": "stderr", "output_type": "stream", "text": [ "\r", "download: 100%|██████████| 14.2M/14.2M [00:02<00:00, 5.23MiB/s]" ] }, { "name": "stderr", "output_type": "stream", "text": [ "\n", "\u001b[32mpp: 14:36:42\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36m_read_edf\u001b[0m:\u001b[36m730\u001b[0m | \u001b[1mLoading EDF file: /tmp/pypillometry_80ga7xxe/download (current log level: INFO, set to DEBUG to see eyelinkio output)\u001b[0m\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "\u001b[32mpp: 14:36:48\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mlocal_copy\u001b[0m:\u001b[36m525\u001b[0m | \u001b[1mDeleting downloaded copy: /tmp/pypillometry_80ga7xxe\u001b[0m\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "\u001b[32mpp: 14:36:48\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mfrom_eyelink\u001b[0m:\u001b[36m1639\u001b[0m | \u001b[1mFiltering out Eyelink triggers\u001b[0m\n" ] }, { "data": { "text/html": [ "
EyeDataDict(vars=6,n=598885,shape=(598885,)): \n",
" left_x (float64): 668.2, 660.6, 650.0, 639.1, 628.4...\n",
" left_y (float64): 491.1, 490.1, 489.4, 488.5, 488.0...\n",
" left_pupil (float64): 724.0, 724.0, 725.0, 727.0, 727.0...\n",
" right_x (float64): 682.8, 679.5, 674.5, 662.7, 644.3...\n",
" right_y (float64): 505.2, 502.9, 501.3, 499.0, 496.4...\n",
" right_pupil (float64): 637.0, 642.0, 644.0, 639.0, 636.0...\n",
"\n",
"