spiketools.objects.Unit¶
- class spiketools.objects.Unit(uid=None, spikes=None, channel=None, region=None, cluster=None)[source]¶
A Unit object.
- Parameters:
- uidstr
Unit ID.
- spikes1d array
Spike times, in seconds.
- channelstr
Channel label.
- regionstr
Region label.
- cluster1d array
Spike cluster.
- __init__(uid=None, spikes=None, channel=None, region=None, cluster=None)[source]¶
Initialize a Unit object.
Methods
__init__
([uid, spikes, channel, region, cluster])Initialize a Unit object.
cv
()Compute coefficient of variation.
fano
()Compute fano factor.
Compute average firing rate.
isis
()Compute inter-spike intervals.
shuffle
([approach, n_shuffles])Shuffle spikes to create surrogates.
Convert spike times into a spike train vector (binary).
- shuffle(approach='ISI', n_shuffles=1000, **kwargs)[source]¶
Shuffle spikes to create surrogates.
- Parameters:
- approach{‘ISI’, ‘BINCIRC’, ‘POISSON’, ‘CIRCULAR’}
Which approach to take for shuffling spike times.
- n_shufflesint, optional, default: 1000
The number of shuffles to create.
- kwargs
Additional keyword arguments for the shuffle functions. See shuffle_spikes for details.