Simulated data: pp.sim#

Simulated recordings with their ground truth: a Simulation is built by chaining steps, Simulation.run() returns a SimEyeData object. See Simulated data for an introduction and Simulated data for examples.

Simulation

Recipe of a simulated recording.

SimEyeData

Simulated eye-tracking data together with the ground truth (made by Simulation.run()).

SimPlotNamespace

Plotting methods of a SimEyeData object (d.plot): those of PlotNamespace and plots of the data together with the ground truth.

Tasks and events#

Task

Design of an experiment: blocks of trials with stimuli and responses.

parse_dist

Distribution of times from its specification.

Ready-made tasks: pp.sim.tasks#

pvt

Psychomotor vigilance task: a visual target at random intervals, which stays until the response.

sart

Sustained attention to response task: digits followed by a mask; press for every digit except 3 (no-go).

ftrsgt

Finger-tapping random-sequence generation task: tap with the left or right finger in synchrony with a beep, in a random sequence, with thought probes at random intervals.

nback

n-back task: a letter every soa; respond to every letter with "match" (same letter as level letters before) or "nomatch".

Steps#

The steps run in a fixed order of stages: events of the task, latent pupil size (log-%), gaze, foreshortening, units of the tracker, blinks (occlusion), noise, losses of the tracker and comb artifacts (missing samples).

TimescalePupil

Latent pupil size from the timescale model (see TimescaleModel): a fast component (Matérn-3/2) and slow components ("atoms") at fixed time scales, in log-%.

Fixations

Gaze as a sequence of fixations at random places on the screen (the same for all eyes).

Foreshortening

Pupil foreshortening: the camera sees the pupil at the angle \(\alpha\) between the directions from the eye to the camera and to the gaze position, so that the measured size is \(A_0 \cos\alpha\).

Units

Units of the tracker: the pupil is \(\text{median} \cdot e^{y / 100}\) for the signal \(y\) in log-%.

Blinks

Blinks: the lid covers the pupil, which the tracker loses while the covered fraction is above visibility.

WhiteNoise

White measurement noise on the pupil.

TrackerLoss

Losses of the pupil by the tracker: stretches of missing samples at random times, without a transient.

Comb

Comb artifacts: bursts of teeth, short dropouts of the pupil with a too-small value on each side, or short drops without missing samples, so that the signal looks like a comb.

blink_occlusion

Occluded fraction of the pupil during a blink (0: open, 1: covered).

parse_rate

Rate of events per ms from "15/min", "0.5/s", "2/h" or a plain number (per minute).

From a fitted model#

TimescaleModel.process

The fitted model as steps of a simulation (see pypillometry.sim).

TimescaleModel.simulate

Simulate a new recording from the fitted model.