Spike_tools.get_spike_stats

Re: Spike_tools.get_spike_stats

by Georgios Iatropoulos -
Number of replies: 0

Hi,

It seems like spike_tools.get_spike_stats and spike_tools.get_spike_time don't work as intended due to a bug in the code. However, you can use spike_tools.get_spike_train_stats instead. This will return essentially the same information. You have to provide the function with the spike_monitor. The spike_monitor contains all spike times, and is part of the Brian2 simulator (see here). Here's an example for the leaky-integrate-and-fire:

(state_monitor, spike_monitor) = LIF.simulate_LIF_neuron(...)
spike_stats = spike_tools.get_spike_train_stats(spike_monitor)
spike_times = spike_monitor.t
print(spike_stats.nr_spikes)
print(spike_stats.all_ISI)
print(spike_times)