carat.util.get_time_segment¶
-
carat.util.
get_time_segment
(y, time, time_ini, time_end)[source]¶ Get a segment of an array, given by initial and ending indexes.
- Args:
- y (numpy array): signal array. Must be a one-dimensional array. time (numpy array): corresponding time. Must be a one-dimensional array. time_ini (int): initial time value. time_end (int): ending time value.
- Returns:
- segment (numpy array): segment of the signal.
- Raises:
- AttributeError if y or time is not a one-dimensional numpy array. ValueError if idx_ini or idx_end fall outside the signal bounds. ValueError if idx_ini >= idx_end.