File: dc_source.py

package info (click to toggle)
pynn 0.10.1-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 6,156 kB
  • sloc: python: 25,612; cpp: 320; makefile: 117; sh: 80
file content (26 lines) | stat: -rw-r--r-- 619 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
"""

"""

from plot_helper import plot_current_source
import pyNN.neuron as sim

sim.setup()

population = sim.Population(10, sim.IF_cond_exp(tau_m=10.0))
population[3:4].record_v()

pulse = sim.DCSource(amplitude=0.5, start=20.0, stop=80.0)
pulse.inject_into(population[3:7])
pulse._record()

sim.run(100.0)

t, i_inj = pulse._get_data()
v = population.get_data().segments[0].analogsignals[0]

plot_current_source(t, i_inj, v,
                    v_range=(-65.5, -59.5),
                    v_ticks=(-65, -64, -63, -62, -61, -60),
                    i_range=(-0.1, 0.55),
                    i_ticks=(0.0, 0.2, 0.4))