pupil_response_coverage#
- pypillometry.signal.pupil_response_coverage(x1, valid)[source]#
Share of each event’s response that falls on valid samples.
The share is weighted by the response (the event’s row in the design matrix), so samples near the peak of the response count more than samples in its tail: an event whose peak is missing gets a low share even if most of its (long) tail is valid.
- Parameters:
x1 (np.ndarray) – design matrix (nevents x n), see
pupil_build_design_matrix()valid (np.ndarray) – boolean array (length n), True for valid samples
- Return type:
np.ndarray
- Returns:
share (0-1) for each event; NaN for events without response in the data (e.g., at the very end)