The idea here is to use NetStim to generate a train of stimuli, save it using Vector, and then using this Vector object as a source for VecStim.
Using the code below, I could generate a train of stimuli with no problem (see stim0 ), but when i check the output from vecstim, it gives me a single stimuli ( see rec0 ). The two should be the same :( Could you give me some pointers?
Code: Select all
import neuron
from neuron import h
from numpy import *
TSTOP = 10000
h("objref nil");
netstim0 = h.NetStim()
netstim0.start = 100 # start 100 ms after netcon.delay
netstim0.noise = 1 # no mpi works fine if noise is set to zero
netstim0.number = 1e9 # 1
netstim0.interval = 2 # 25
nc0 = h.NetCon(netstim0, h.nil)
stim0 = h.Vector()
nc0.record(stim0)
h.finitialize(-65)
neuron.run(TSTOP)
print array(stim0)
vs0 = h.VecStim()
vs0.play(stim0)
nc0 = h.NetCon(vs0, h.nil)
rec0 = h.Vector()
nc0.record(rec0)
h.finitialize(-65)
neuron.run(TSTOP)
print array(rec0)