Open datasets#
pypillometry comes with a few open datasets: whole studies whose data are
on OSF or figshare. The data are not part of pypillometry; they are
downloaded when you first need them and kept in a folder (see
Where the data are stored). Please cite the study (ds.cite()) when you use
its data.
import pypillometry as pp
pp.datasets.list_datasets() # name, tracker, tasks, subjects, size
ds = pp.datasets.get("robison2022")
ds # summary of the dataset
ds.cite()
d = ds.load("1727", "pvt") # downloads the recording if needed
name |
dataset |
|---|---|
|
|
|
|
An open dataset has the same methods as your own study (tables, loading, excluding, preprocessing, segments); see Analysing a study.
Downloading#
load() downloads the files of one recording when they are
needed. download() downloads the whole dataset or some
subjects and tasks (several at a time). Each recording is converted to a
pypillometry file right after the download and its raw files are deleted;
from then on it loads from that file and is not downloaded again (unless
download(overwrite=True)).
ds.download() # everything (see ds.info()["size"])
ds.download(subjects=["1545", "1727"]) # some subjects, all tasks
Each file is checked against the checksum in the dataset’s manifest (the list of its files with their checksums, which comes with pypillometry), and downloaded again if it does not match.
Where the data are stored#
By default in ~/.cache/pypillometry/datasets/<name> (or
$XDG_CACHE_HOME/pypillometry/datasets/<name>): the recordings as
pypillometry files in pypil/, the tables with the paths of the
repository. To keep the raw files too, use
pp.datasets.get(name, keep_raw=True). Set the environment variable PYPILLOMETRY_DATA_DIR to keep
all datasets somewhere else (then in $PYPILLOMETRY_DATA_DIR/<name>), or
give a folder for one dataset:
ds = pp.datasets.get("robison2022", path="/data/robison2022")