I want to insert a spike train into a cell via a synapse, e.g. ExpSyn.
How do I do that in Python?
I could not manage to translate my hoc code which does exactly that, so I wondered if there is maybe another way.
The hoc code which works makes use of the FInitializeHandler which then calls a function to insert the spike times into the cell's netconlist:
Code: Select all
fih = new FInitializeHandler("initspikes()")
proc initspikes(){
...for (int i=0; i<stvec.size(); i+=1) {
cell.netconlist.o(0).event(stvec.x[i]) //stvec contains the spiketimes
}
}
// the cell template includes something like:
soma syn = new ExpSyn(0.5)
synlist.append(syn) //synlist[0]
nc = new NetCon(nullobject, syn, threshold, delay, weight)
netconlist.append(nc) //netconlist[0]
Code: Select all
initspikes()
finitialize(-65)
init()
stdinit()
NEURON: initspikes undefined function
Would be great if someone could post some python code, which does the job.
Many thanks in advance!