tweak_blink_interpolation#
- pypillometry.tweak_blink_interpolation(data, pars=None, method=None, eye=None, interval=None, duration=30, units='sec', seed=None)[source]#
Tweak the parameters of the interpolation of blinks interactively.
Opens
tweak()with the pupil of one eye and its interpolation byblinks_interpolate()overlaid; the parameters can be changed in the panel (the margin asmargin_beforeandmargin_after). “Auto Update” is off, as the interpolation takes a moment: press “Update” (or Enter) to see the result. To keep it quick, only a short part of the recording is shown: by default duration around a random blink outside the excluded periods (another one with another seed), or the given interval.- Parameters:
data (EyeData) – data with detected blinks (see
blinks_detect())pars (dict or BlinkTuneResult, optional) – starting parameters as arguments of
blinks_interpolate(), e.g.result.paramsofblinks_optimize_parameters()(or the result itself); missing ones are the defaultsmethod (str, optional) –
"mahot"or"kalman"; default:pars["method"], or"mahot". The fields of the panel are the parameters of this method.eye (str, optional) – eye to show; default: the first eye with pupil data
interval (tuple, optional) – (start, end) of the part to show (values of the time vector, in units); default: duration around a random blink
duration (float) – length of the part around a random blink (in units)
units (str) – units of interval and duration (default seconds)
seed (int, optional) – seed for the choice of the blink
- Return type:
- Returns:
the final parameters, as arguments of
blinks_interpolate()(including the method), e.g. ford.pupil.blinks_interpolate(**result)
Examples
>>> d = d.pupil.blinks_detect() >>> res = d.pupil.blinks_optimize_parameters() >>> pars = pp.tweak_blink_interpolation(d, pars=res) >>> d = d.pupil.blinks_interpolate(**pars)