pynbody.chunk.scan.scan_for_next_stop#
- pynbody.chunk.scan.scan_for_next_stop(ids, offset_start, id_maximum)#
Scan for the next stop in a sorted list of integers.
- Parameters:
ids (np.ndarray[np.int64_t, ndim=1, mode="c"]) – A sorted list of integers.
offset_start (int) – The index in the list to start the search from.
id_maximum (int) – The maximum value to search for.
- Returns:
index – The index into the list of the last element that is less than or equal to id_maximum, or -1 if the search failed.
- Return type:
int