pynapple.process.randomize#
Functions to shuffle timestamps to create surrogate datasets.
Functions
|
Jitters each time stamp independently of random amounts uniformly drawn between -max_jitter and max_jitter. |
Resamples the timestamps in the time support, with uniform distribution. |
|
|
Shifts all the time stamps of a random amount between min_shift and max_shift, wrapping the end of the time support to the beginning. |
|
Randomizes the timestamps by shuffling the intervals between them. |
- pynapple.process.randomize.jitter_timestamps(ts, max_jitter=None, keep_tsupport=False)[source]#
Jitters each time stamp independently of random amounts uniformly drawn between -max_jitter and max_jitter.
- Parameters:
ts (Ts or TsGroup) – The timestamps to jitter. If TsGroup, jitter is applied to each element of the group.
max_jitter (float) – maximum jitter
keep_tsupport (bool, optional) – If True, keep time support of the input. The number of timestamps will not be conserved. If False, the time support is inferred from the jittered timestamps. The number of tmestamps is conserved. (default: False)
- Returns:
The jittered timestamps
- Return type:
- pynapple.process.randomize.resample_timestamps(ts)[source]#
Resamples the timestamps in the time support, with uniform distribution.
- pynapple.process.randomize.shift_timestamps(ts, min_shift=0.0, max_shift=None)[source]#
Shifts all the time stamps of a random amount between min_shift and max_shift, wrapping the end of the time support to the beginning.
- Parameters:
- Returns:
The randomly shifted timestamps
- Return type: