EventMonitor class

(Shortest import: from brian2 import EventMonitor)

class brian2.monitors.spikemonitor.EventMonitor(*args, **kw)[source]

Bases: Group, CodeRunner

Record events from a NeuronGroup or another event source.

The recorded events can be accessed in various ways: the attributes i and t store all the indices and event times, respectively. Alternatively, you can get a dictionary mapping neuron indices to event trains, by calling the event_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) calling values for each variable and storing the result in a dictionary.

event_trains()[source]

Return a dictionary mapping neuron indices to arrays of event times. Equivalent to calling values('t').

reinit()[source]

Clears all recorded spikes

resize(new_size)[source]
values(var)[source]

Return a dictionary mapping neuron indices to arrays of variable values at the time of the events (sorted by time).