Spike_tools.get_spike_stats

Spike_tools.get_spike_stats

by Inès De Riedmatten -
Number of replies: 1
Hi everyone!

I was wondering if someone managed to use the function Spike_tools.get_spike_stats()?

Thank you in advance :)

Inès
In reply to Inès De Riedmatten

Re: Spike_tools.get_spike_stats

by Georgios Iatropoulos -

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)