File: create_spikes.py

package info (click to toggle)
bmtk 1.1.1%2Bds-4
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 204,040 kB
  • sloc: python: 37,064; javascript: 1,998; makefile: 42; sh: 33
file content (9 lines) | stat: -rw-r--r-- 377 bytes parent folder | download
1
2
3
4
5
6
7
8
9
from bmtk.utils.reports.spike_trains import PoissonSpikeGenerator

psg = PoissonSpikeGenerator(population='mthalamus')
psg.add(
    node_ids=range(10),  # Have 10 nodes to match mthalamus
    firing_rate=10.0,    # 10 Hz, we can also pass in a nonhomoegenous function/array
    times=(0.0, 3.0)    # Firing starts at 0 s up to 3 s
)
psg.to_sonata('inputs/mthalamus_spikes.h5')