stnmf.preprocessing.spiketriggered.average

stnmf.preprocessing.spiketriggered.average(stimulus, spikes, tau, continuous=False, tqdm_args=None)

Compute the spike-triggered average (STA) for multiple cells

Parameters:
  • stimulus (iterator or array_like) – This iterator should yield a (x,y,trial_length) array_like for each trial, where trial_length matches the number of elements of spikes

  • spikes ((num_trials,trial_length,num_cells) array_like) – Binned spike counts of multiple cells. If two dimensional, assume num_cells == 1

  • tau (int) – Temporal filter length

  • continuous (bool, optional) – Specify if trials should be treated as connected chunks of a continuous recording or if they are separated. Default is False

  • tqdm_args (dict, optional) – Arguments to pass to tqdm progress bar. If empty, tqdm is not used. Default is None

Returns:

sta ((num_cells,x,y,tau) numpy.ndarray) – STAs of all cells