neuralib.util.segments.shuffle_time
- neuralib.util.segments.shuffle_time(t, method, segs=None, duration=inf, circular=True)[source]
Shuffle t by remapping function method for t in segs.
- Parameters:
t (ndarray) – (N,) T-value array
method (Callable[[ndarray], ndarray]) – time remapping function with signature ((K,) T-value array) -> (K,) T-value array
segs (ndarray | None) – (S, 2) segment, only shift time in the segments.
duration (float) – The maximal T value
circular (bool) – keep total event number. If epochs is given, keep total event number in epochs.
- Returns:
(N’,) T-value array
- Return type:
ndarray