stnmf.preprocessing.spiketriggered.stimulusensemble
- stnmf.preprocessing.spiketriggered.stimulusensemble(stimulus, spikes, sta_temp, continuous=False, min_spikes_per_bin=1, dtype='float32')
Collect the effective spike-triggered stimulus ensemble (STE)
- Parameters:
stimulus (
iteratoror 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. The stimulus should be cropped around the cell’s receptive field. See function windowspikes (
(num_trials,trial_length,num_cells) array_like) – Binned spike counts of one cell, i.e. num_cells has to be 1 (see notes). If two dimensional, assume num_cells == 1sta_temp (
(tau,) array_like) – Temporal profile of the spike-triggered average. See function profilescontinuous (
bool, optional) – Specify if trials should be treated as connected chunks of a continuous recording or if they are separated. Default is Falsemin_spikes_per_bin (
int, optional) – Specify the minimum number of spikes per bin to be considered. This is useful for cells with high baseline firing rate. Default is 1dtype (
strornumpy.dtype, optional) – Data type in which to perform and return the computations. Default is ‘float32’
- Returns:
ste (
(x,y,s) numpy.ndarray) – Effective Spike-triggered stimulus ensemble, where s is the number of spikes- Raises:
NotImplementedError : – If the last dimension of the spikes array is greater than one
Notes
The current implementation only supports spikes from one cell at a time.
Each spike yields one spike-triggered stimulus, that is, multiple spikes in one bin result in identical successive spike-triggered stimulus frames in the STE.