neuralib.util.segments.shift_time

neuralib.util.segments.shift_time(t, shift, segs=None, *, duration=inf, circular=True)[source]

Shift t with a shift value for t in segs.

Parameters:
  • t (ndarray) – (N,) T-value array

  • shift (float) – shift T value, positive value.

  • segs (ndarray | None) – (S, 2) segment, only shift time in the segments.

  • duration (float) – The maximal T value for wrapping when circular

  • circular (bool) – keep total event number. If epochs is given, keep total event number in epochs.

Returns:

(N’,) T-value array

Return type:

ndarray