neuralib.locomotion.position.CircularPosition

class neuralib.locomotion.position.CircularPosition[source]

Bases: NamedTuple

Position information in circular environment.

Dimension parameters:

P = Number of position points (after interpolation)

T = Number of trial(lap)

t: ndarray

1D time array in s. Array[float, P]

p: ndarray

1D position array in cm. Array[float, P]

d: ndarray

1D displacement array in cm. Array[float, P]

v: ndarray

1D velocity array in cm/s. Array[float, P]

trial_time_index: ndarray

1D time index for every trial. Array[int, T]

with_time_range(t0, t1)[source]

With specific time range

Parameters:
  • t0 (float) – time start

  • t1 (float) – time end

Returns:

A new instance of the class with updated subset of attributes (t, p, d, v) based on the time range.

Return type:

Self

with_run_mask1d(**kwargs)[source]

With only the running epoch. Note that shape will be changed (stationary epoch excluded)

Parameters:

kwargs – Additional keyword arguments to pass to running_mask1d function.

Returns:

A new instance of the class with updated subset of attributes (t, p, d, v) based on the mask generated.

Return type:

Self

property trial_array: ndarray

Trial number array as same shape as P

Returns:

Array[int, P]

static __new__(_cls, t, p, d, v, trial_time_index)

Create new instance of CircularPosition(t, p, d, v, trial_time_index)

Parameters:
  • t (ndarray)

  • p (ndarray)

  • d (ndarray)

  • v (ndarray)

  • trial_time_index (ndarray)

count(value, /)

Return number of occurrences of value.

index(value, start=0, stop=9223372036854775807, /)

Return first index of value.

Raises ValueError if the value is not present.