neuralib.locomotion.epoch.running_mask1d
- neuralib.locomotion.epoch.running_mask1d(time, velocity, *, threshold=5, merge_gap=0.5, minimal_time=1)[source]
Running epoch mask for linear (1-dimension) locomotion.
Refer to Zaremba et al., 2016. Nature Neuroscience. Selection based on criterion:
Forward locomotion
Velocity > threshold (default greater than 5 cm/s)
Merge the gap period (default 0.5 sec, if animal accidentally slow down)
Each segmented epoch need to longer than (default is 1 second)
Dimension parameters:
P = Number of position points
- Parameters:
time (ndarray) – 1D time array of the position. Array[float, P]
velocity (ndarray) – 1D velocity array. Array[float, P]
threshold (float) – Velocity threshold in cm/s
merge_gap (float) – Merge gap in seconds (i.e., animal accidentally slow down in a short period of time)
minimal_time (float) – Epoch minimal time in seconds
- Returns:
Running epoch mask. Array[bool, P]
- Return type:
ndarray