Skip to content

remove_close fails to complete #3

Description

@MarcusVollmer

Dear Juho,

I have several beat locations derived from 10-second ECGs than cannot be processed by your filter function to remove physiologically implausible close locations. Please have a look at the following output from a record sampled at 500Hz:

>>> peaks
array([ 180,  201,  454,  474,  719,  739,  764,  976,  997, 1022, 1246,
       1267, 1516, 1537, 1778, 1798, 2042, 2063, 2314, 2334])
>>> probs
array([0.49186349, 0.38749108, 0.57148891, 0.43434726, 0.5376877 ,
       0.40901706, 0.21033455, 0.67790574, 0.39221896, 0.13146529,
       0.63408794, 0.57205515, 0.59101564, 0.48511908, 0.59304953,
       0.5121345 , 0.51543932, 0.50958154, 0.60621216, 0.48644364])

As ok_peaks is empty, an indexing error occurs:

 line 459, in remove_close
    if max_peak < ok_peaks[0]:
IndexError: index 0 is out of bounds for axis 0 with size 0

The empty array ok_peaks is defined here:

ok_peaks = peaks[~np.isin(peaks, close_peaks)]

Best,
Marcus

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions