blink_donors#
- pypillometry.signal.blink_donors(cores, missing, window, min_len=1, max_len=None)[source]#
Select the blinks that can be transplanted.
A blink can be transplanted if the window around its core is inside the data and has no missing samples other than the core itself (e.g., no other blink), so that the artifact around the blink can be separated from the signal.
- Parameters:
cores (np.ndarray) – cores of the blinks (n x 2, end-exclusive), see
blink_cores()missing (np.ndarray of bool) – samples without usable signal (the cores and, e.g., samples that are masked for other reasons)
window (int or tuple of int) – number of samples (before, after) the core that belong to the blink
min_len (int) – only cores with at least min_len and at most max_len samples are used (e.g., no single missing samples, no long periods without data); max_len=None: no limit
max_len (int) – only cores with at least min_len and at most max_len samples are used (e.g., no single missing samples, no long periods without data); max_len=None: no limit
- Return type:
- Returns:
True for the cores that can be transplanted