indexes function slow for certain type of arrays

Issue #32 resolved
Ask Krogstad created an issue

For arrays such as:

import numpy as np
signal_sin = np.sin(np.arange(0,10,0.001))
signal_zero = np.zeros_like(signal_sin)
signal = np.tile(np.concatenate((signal_sin, signal_zero)), 50)

peakutils.indexes is very slow. This is due to the current way of removing zero values in dy.

I have arrays like this where periods of noise in the data create long plateaus of zero values.

I'll submit a PR with a proposed change.

Comments (2)

  1. Lucas Hermann Negri repo owner

    I confirm this issue and welcome the PR (please check the initial PR review).

  2. Log in to comment