bundles / scipy 1.18.0 / scipy / signal / _peak_finding / _identify_ridge_lines
function
scipy.signal._peak_finding:_identify_ridge_lines
Signature
def _identify_ridge_lines(matr, max_distances, gap_thresh)Summary
Identify ridges in the 2-D matrix.
Extended Summary
Expect that the width of the wavelet feature increases with increasing row number.
Parameters
matr: 2-D ndarrayMatrix in which to identify ridge lines.
max_distances: 1-D sequenceAt each row, a ridge line is only connected if the relative max at row[n] is within `max_distances`[n] from the relative max at row[n+1].
gap_thresh: intIf a relative maximum is not found within
max_distances, there will be a gap. A ridge line is discontinued if there are more thangap_threshpoints without connecting a new relative maximum.
Returns
ridge_lines: tupleTuple of 2 1-D sequences. `ridge_lines`[ii][0] are the rows of the ii-th ridge-line, `ridge_lines`[ii][1] are the columns. Empty if none found. Each ridge-line will be sorted by row (increasing), but the order of the ridge lines is not specified.
Notes
This function is intended to be used in conjunction with cwt as part of find_peaks_cwt.
Examples
import numpy as np from scipy.signal._peak_finding import _identify_ridge_lines rng = np.random.default_rng() data = rng.random((5,5)) max_dist = 3 max_distances = np.full(20, max_dist) ridge_lines = _identify_ridge_lines(data, max_distances, 1)✓
Aliases
scipy.signal._peak_finding._identify_ridge_lines