neuralib.locomotion.epoch.jump_mask2d

neuralib.locomotion.epoch.jump_mask2d(time, xy, jump_size, max_duration=0.1)[source]

UNSTABLE.

Find jump epoch in 2D xy locomotion

Parameters:
  • time (ndarray) – A 1D numpy array of time points corresponding to each xy coordinate. Array[bool, N]

  • xy (ndarray) – A 2D numpy array of x and y coordinates representing positions. Array[float, [N, 2]]

  • jump_size (float) – A float representing the minimum jump distance to be considered significant between consecutive points. Should be expressed in the same coordinates as xy

  • max_duration (float) – the maximum duration (in the same units as t) of a jump. If a jump lasts longer the duration, it will not be removed (as it may not actually be a jump)

Returns:

A tuple containing:

  • A boolean numpy array indicating which points are part of a detected jump segment. Array[bool, N]

  • A list of segments, where each segment is represented by a list of two indices [start_idx, end_idx].

Return type:

tuple[ndarray, ndarray | tuple[float, float] | list[tuple[float, float]]]