speed

nrv.ui.speed(my_dict, position_key=None, t_start=0, t_stop=0, x_start=0, x_stop=0)[source]

Compute the velocity of a spike from rasterized data in a dictionary. The speed can be either positive or negative depending on the propagation direction.

Parameters:
  • my_dict (dictionary) – dictionary where the quantity should be rasterized

  • key (str) – name of the key to consider, if None is specified, the rasterized is automatically chose with preference for filtered-rasterized keys.

  • t_start (float) – time at which the spikes are processed, in ms. By default 0

  • t_stop (float) – maximum time at which the spikes are processed, in ms. If zero is specified, the spike detection is applied to the full signal duration. By default set to 0.

  • x_start (float) – minimum position for spike processing, in um. By default set to 0.

  • x_stop (float) – maximum position for spike processing, in um. If 0 is specified, spikes are processed on the full axon length . By default set to 0.

Returns:

speed – velocity.

Return type:

float

Note

the velocity is computed with first and last occurance of a spike, be careful specifying the computation window if multiple spikes. This function will not see velocity variation.