def _sort_contours(self, index, times, freqs, salience):
"""Sort contours by index and time.
Parameters
----------
index : np.array
array of contour numbers
times : np.array
array of contour times
freqs : np.array
array of contour frequencies
salience : np.array
array of contour salience values
Returns
-------
index_sorted : np.array
Pruned array of contour numbers
times_sorted : np.array
Pruned array of contour times
freqs_sorted : np.array
Pruned array of contour frequencies
salience_sorted : np.array
Pruned array of contour salience values
"""
sort_idx = np.lexsort((times, index))
return (
index[sort_idx], times[sort_idx], freqs[sort_idx],
salience[sort_idx]
)
###############################################################################
评论列表
文章目录