EventMonitor class¶
(Shortest import: from brian2 import EventMonitor)
- class brian2.monitors.spikemonitor.EventMonitor(*args, **kw)[source]¶
Bases:
Group,CodeRunnerRecord events from a
NeuronGroupor another event source.The recorded events can be accessed in various ways: the attributes
iandtstore all the indices and event times, respectively. Alternatively, you can get a dictionary mapping neuron indices to event trains, by calling theevent_trainsmethod.Attributes
The array of event counts (length = size of target group)
The event that we are listening to
Returns the pair (
i,t).Returns the pair (
i,t_).Returns the total number of recorded events.
Whether to record times and indices of events
The additional variables that will be recorded
The source we are recording from
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 events (sorted by time).Return a dictionary mapping neuron indices to arrays of event times.
reinit()Clears all recorded spikes
resize(new_size)values(var)Return a dictionary mapping neuron indices to arrays of variable values at the time of the events (sorted by time).
Details
- count¶
The array of event counts (length = size of target group)
- event¶
The event that we are listening to
- it¶
Returns the pair (
i,t).
- it_¶
Returns the pair (
i,t_).
- num_events¶
Returns the total number of recorded events.
- record¶
Whether to record times and indices of events
- record_variables¶
The additional variables that will be recorded
- source¶
The source we are recording from
- 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 events (sorted by time). This is equivalent to (but more efficient than) callingvaluesfor each variable and storing the result in a dictionary.