BlinkTransplant#

class pypillometry.signal.BlinkTransplant(signal, clean, blinks, windows, sites, donor, donors, artifacts, window=(0, 0), mode='additive', profile=None)[source]#

Bases: object

A signal with transplanted blinks (see transplant_blinks()).

Attributes:
signalnp.ndarray

the signal with the transplanted blinks

cleannp.ndarray

the signal without them (the ground truth)

blinksnp.ndarray

the cores of the transplanted blinks (n x 2, end-exclusive): from the first to the last missing sample

windowsnp.ndarray

the windows that hold the transplanted artifacts (n x 2)

sitesnp.ndarray

the windows with the clean samples reserved around them (n x 2); the errors of a reconstruction are computed in the sites (see transplant_error())

donornp.ndarray

index (into donors) of the blink that was transplanted to each site

donorsnp.ndarray

the cores of the blinks that were cut out (n x 2)

artifactslist of np.ndarray

their artifacts (see extract_blink_artifacts())

windowtuple of int

number of samples (before, after) the cores in the windows

modestr

"additive" or "multiplicative"

profiledict or None

the median artifact and the weights of the single artifacts (see blink_artifact_profile()) that were used to remove the fluctuations of the signal from the artifacts

Methods

error

RMSE of the reconstruction filled (see transplant_error()).

Details

error(filled, per_site=False)[source]#

RMSE of the reconstruction filled (see transplant_error()).

Return type:

float | ndarray