Module optional

operalib.optional implements optinal features for OVK learning such as period detection for periodic kernels.

operalib.optional.indexes(y, thres=0.05, min_dist=2)

Peak detection routine.

Finds the peaks in y by taking its first order difference. By using thres and min_dist parameters, it is possible to reduce the number of detected peaks. y must be signed.

Parameters:

y : ndarray (signed)

1D amplitude data to search for peaks.

thres : float between [0., 1.]

Normalized threshold. Only the peaks with amplitude higher than the threshold will be detected.

min_dist : int

Minimum distance between each detected peak. The peak with the highest amplitude is preferred to satisfy this constraint.

Returns:

ndarray

Array containing the indexes of the peaks that were detected