get_window_index_pairs_from_durations#
- petpal.utils.scan_timing.get_window_index_pairs_from_durations(frame_durations: numpy.ndarray, window_duration: float) numpy.ndarray#
Computes start and end index pairs for windows of a given size based on frame durations.
- Parameters:
frame_durations (np.ndarray) – Array of frame durations in seconds.
window_duration (float) – Window size in seconds.
- Returns:
np.ndarray –
- Array of shape (2, N), where the first row contains start indices,
and the second row contains end indices for each window.
- Raises:
ValueError – If window_duration is less than or equal to 0.
ValueError – If window_duration is greater than the total duration of all frames.