SpikeMonitor class¶
(Shortest import: from brian2 import SpikeMonitor)
- class brian2.monitors.spikemonitor.SpikeMonitor(*args, **kw)[source]¶
Bases:
EventMonitorRecord spikes from a
NeuronGroupor other spike source.The recorded spikes can be accessed in various ways (see Examples below): the attributes
iandtstore all the indices and spike times, respectively. Alternatively, you can get a dictionary mapping neuron indices to spike trains, by calling thespike_trainsmethod. If you record additional variables with thevariablesargument, these variables can be accessed by their name (see Examples).Attributes
The array of spike counts (length = size of target group)
Returns the total number of recorded spikes.
Methods
Return a dictionary mapping recorded variable names (including
t) to a dictionary mapping neuron indices to arrays of variable values at the time of the spikes (sorted by time).Return a dictionary mapping neuron indices to arrays of spike times.
values(var)Return a dictionary mapping neuron indices to arrays of variable values at the time of the spikes (sorted by time).
Details
- count¶
The array of spike counts (length = size of target group)
- num_spikes¶
Returns the total number of recorded spikes.
- all_values()[source]¶
Return a dictionary mapping recorded variable names (including
t) to a dictionary mapping neuron indices to arrays of variable values at the time of the spikes (sorted by time). This is equivalent to (but more efficient than) callingvaluesfor each variable and storing the result in a dictionary.