transplant_error#

pypillometry.signal.transplant_error(filled, clean, sites, per_site=False)[source]#

Error of a reconstruction of transplanted blinks.

Root mean squared difference between the reconstructed and the clean signal over all samples of the sites, i.e., the samples of the cores, of the artifacts around them and of the clean signal next to them (a reconstruction can replace more samples than necessary). Samples that are still missing in filled (NaN) are interpolated linearly first, so that reconstructions that leave blinks out can be compared.

Parameters:
  • filled (np.ndarray) – the signal with the reconstructed blinks

  • clean (np.ndarray) – the signal without the transplanted blinks

  • sites (np.ndarray) – the sites of the transplanted blinks (n x 2, end-exclusive), see BlinkTransplant

  • per_site (bool) – return the error of each site instead of the error over all sites

Return type:

float | ndarray

Returns:

the error (NaN without sites), or one error per site