EventMonitor class¶
(Shortest import: from brian2 import EventMonitor)
-
class
brian2.monitors.spikemonitor.
EventMonitor
(source, event, variables=None, record=True, when=None, order=None, name='eventmonitor*', codeobj_class=None)[source]¶ Bases:
brian2.groups.group.Group
,brian2.groups.group.CodeRunner
Record events from a
NeuronGroup
or another event source.The recorded events can be accessed in various ways: the attributes
i
andt
store all the indices and event times, respectively. Alternatively, you can get a dictionary mapping neuron indices to event trains, by calling theevent_trains
method.Attributes
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 Methods
all_values
()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).event_trains
()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) callingvalues
for each variable and storing the result in a dictionary.
-