barak.utilities.find_edges_true_regions¶
- barak.utilities.find_edges_true_regions(condition)[source]¶
Finds the indices for the edges of contiguous regions where condition is True.
Examples
>>> a = np.array([3,0,1,4,6,7,8,6,3,2,0,3,4,5,6,4,2,0,2,5,0,3]) >>> ileft, iright = find_edges_true_regions(a > 2) >>> zip(ileft, iright) [(0, 0), (3, 8), (11, 15), (19, 19), (21, 21)]