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 (7 lines) | stat: -rw-r--r-- 381 bytes parent folder | download
1
2
3
4
5
6
7
from bmtk.utils.reports.spike_trains import PoissonSpikeGenerator

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