Defining event times in the 'NetCon' object
Posted: Wed Oct 19, 2011 12:49 pm
I am trying to deliver a train of synaptic inputs to a cell at specified times using the event property of the 'NetCon' function and the 'Exp2Syn' mechanism. I have been able to do this in HOC but I'm having problems doing this in Python.
An example of the typical structure of my HOC code is the following:
Now below is the general way I am trying to perform the same steps in Python:
The call to 'FInitializeHandler' causes Python to crash. I know there are many possible reasons this is not working. Is the HOC syntax of 'nc.event(tdeliver)' the correct syntax for assigning the event times in Python? How and when is the correct time to call 'FInitializeHandler' in Python? This method of delivering synaptic inputs works fine in HOC but do you recommend a different method for doing this?
Thanks for the help!
An example of the typical structure of my HOC code is the following:
Code: Select all
//Define synaptic inputs
objref syn[1], nc[1]
create soma
soma {
insert hh
syn[0] = new Exp2Syn(.5)
nc[0] = new NetCon(&v(0.5), syn[0])
}
//Applying synaptic inputs
objref syntimes
syntimes=new Vector(3)
syntimes.x[0]=100
syntimes.x[1]=200
syntimes.x[2]=300
objref fih
fih = new FInitializeHandler("loadqueue()")
proc loadqueue() { local ii
for ii=0,syntimes.size()-1 nc[0].event(syntimes.x[ii])
}
Code: Select all
from neuron import h
soma=h.Section()
soma.insert('hh')
syn = h.Exp2Syn(0.5,sec=soma)
nc = h.NetCon(soma(0.5)._ref_v,syn)
syntimes=[100,200,300]
def loadqueue():
for i in syntimes:
nc.event(i)
fih=h.FInitializeHandler(1,loadqueue())
Thanks for the help!