{ "cells": [ { "cell_type": "markdown", "id": "e0c4f29b", "metadata": {}, "source": [ "# Example datasets included in `pypillometry`\n", "\n", "`pypillometry` comes with a set of example dataset for convenience (so that you can easily start trying the package).\n", "\n", "Some smaller datasets are included directly in the package, others will be downloaded when requested. The datasets can be retrieved with the `get_dataset()` function." ] }, { "cell_type": "code", "execution_count": 1, "id": "efdd19c5", "metadata": {}, "outputs": [], "source": [ "import sys\n", "sys.path.insert(0,\"..\") # this is not needed if you have installed pypillometry\n", "import pypillometry as pp" ] }, { "cell_type": "markdown", "id": "086af5b4", "metadata": {}, "source": [ "You can get an overview over all available datasets:" ] }, { "cell_type": "code", "execution_count": 6, "id": "0dbc049c", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
DatasetTypeDescription
0rlmw_002ASC (OSF)Binocular data from a 20-minute reinforcement ...
1rlmw_002_shortASC (local)Short version (first 40 sec) of a 20-minute re...
2rlmw_010_edfEDFBinocular data from a 20-minute reinforcement ...
\n", "
" ], "text/plain": [ "{'rlmw_002': {'samples_asc': 'https://osf.io/download/67cec1a4fb24855200fd6db7/',\n", " 'events_asc': 'https://osf.io/download/67cec1a183c337a5effd6fb6/',\n", " 'description': 'Binocular data from a 20-minute reinforcement learning task.Data from a single participant, features strong horizontal eye-movementsbetween the two stimuli presented on the left and right.'},\n", " 'rlmw_002_short': {'sample_asc': PosixPath('/home/mmi041/Dropbox/work/projects/pupil/pypillometry/docs/../pypillometry/data/002_rlmw_samples_short.asc'),\n", " 'events_asc': PosixPath('/home/mmi041/Dropbox/work/projects/pupil/pypillometry/docs/../pypillometry/data/002_rlmw_events_short.asc'),\n", " 'description': 'Short version (first 40 sec) of a 20-minute reinforcement learning task.Data from a single participant, features strong horizontal eye-movementsbetween the two stimuli presented on the left and right.'},\n", " 'rlmw_010_edf': {'edf': 'https://osf.io/trsuq/download',\n", " 'description': 'Binocular data from a 20-minute reinforcement learning task in EDF (Eyelink) format.Data from a single participant, features strong horizontal eye-movementsbetween the two stimuli presented on the left and right.'}}" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "pp.get_available_datasets()" ] }, { "cell_type": "markdown", "id": "5bb21391", "metadata": {}, "source": [ "Using the identifier, you can load the dataset into python using the `get_example_data()` function" ] }, { "cell_type": "code", "execution_count": 8, "id": "fd016fed", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "002_rlmw_samples.asc: 100%|██████████| 35.1M/35.1M [00:03<00:00, 11.8MiB/s]\n", "002_rlmw_events.asc: 100%|██████████| 1.07M/1.07M [00:00<00:00, 5.16MiB/s]\n" ] }, { "data": { "text/plain": [ "EyeData(test short, 59.3MiB):\n", " n : 597301\n", " sampling_rate : 500.0\n", " data : ['left_x', 'left_y', 'left_pupil', 'right_x', 'right_y', 'right_pupil']\n", " nevents : 1320\n", " screen_limits : ((0, 1280), (0, 1024))\n", " physical_screen_size: (30, 20)\n", " screen_eye_distance : not set\n", " duration_minutes : 19.910033333333335\n", " start_min : 0.0\n", " end_min : 19.91\n", " parameters : {}\n", " glimpse : EyeDataDict(vars=6,n=597301,shape=(597301,)): \n", " left_x (float64): 655.6, 655.7, 655.0, 654.5, 655.0...\n", " left_y (float64): 599.9, 598.9, 597.6, 597.8, 597.8...\n", " left_pupil (float64): 1121.0, 1122.0, 1124.0, 1126.0, 1126.0...\n", " right_x (float64): 773.1, 773.8, 774.8, 776.3, 776.7...\n", " right_y (float64): 594.2, 593.9, 596.5, 597.4, 597.3...\n", " right_pupil (float64): 949.0, 951.0, 956.0, 959.0, 960.0...\n", "\n", " eyes : ['left', 'right']\n", " nblinks : {}\n", " blinks : {'left': None, 'right': None}\n", " params : {}\n", " History:\n", " *\n", " └ fill_time_discontinuities()\n", " └ reset_time()" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "pp.get_example_data(\"rlmw_002\")" ] } ], "metadata": { "kernelspec": { "display_name": "pypil", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.12.5" } }, "nbformat": 4, "nbformat_minor": 5 }