spiketools.spatial.utils.compute_pos_ranges

spiketools.spatial.utils.compute_pos_ranges(position)[source]

Compute the range of positions.

Parameters:
position1d or 2d array

Position data.

Returns:
ranges1d array or list of 1d array

Ranges for each dimension in the spatial data.

Examples

Compute the 2d position ranges for: (x, y) = (1.5, 6.5), (2.5, 7.5), (3.5, 8.5), (5.1, 9.1).

>>> position = np.array([[1.5, 2.5, 3.5, 5.1], [6.5, 7.5, 8.5, 9.1]])
>>> compute_pos_ranges(position)
[array([1.5, 5.1]), array([6.5, 9.1])]

Compute the 1d position range for: x = 1.5, 2.5, 3.5, 5.1

>>> position = np.array([1.5, 2.5, 3.5, 5.1])
>>> compute_pos_ranges(position)
array([1.5, 5.1])