blink_artifact_profile#
- pypillometry.signal.blink_artifact_profile(artifacts, null_artifacts, window)[source]#
The typical artifact of the blinks and how reliable the single ones are.
A single artifact (see
extract_blink_artifacts()) also contains the fluctuations of the signal around that blink, which cannot be told apart from its artifact. Over all blinks, they can: the fluctuations average out in the median artifact, and their size is known from “artifacts” that were cut out where there is no blink (null_artifacts). Where the artifacts differ more from each other than these do, the blinks differ. The weight of the single artifacts is the share of their variance (across blinks) that is not explained by the fluctuations:1 - s**2 / v**2for the robust standard deviations v of the artifacts and s of the null artifacts at each sample (at least 0), made non-increasing with the distance to the core.- Parameters:
- Return type:
- Returns:
"median": the median artifact,"weight": the weight of the single artifacts (between 0 and 1); each a tuple (before, after) of arrays for the samples before the core (the last one is next to the core) and after it (the first one is next to it)