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.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
countThe array of event counts (length = size of target group) eventThe event that we are listening to itReturns the pair ( i,t).it_Returns the pair ( i,t_).num_eventsReturns the total number of recorded events. recordWhether to record times and indices of events record_variablesThe additional variables that will be recorded sourceThe 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) callingvaluesfor each variable and storing the result in a dictionary.
-