Page 1 of 1

Better conductance input idiom?

Posted: Fri Aug 22, 2008 1:50 pm
by emuller
Is there a better way to play a specified conductance input than what I'm doing below?

Code: Select all

# create an SEClamp object which is accessible in both python and NEURON
soma.push()
h('objref estim')
h('estim = new SEClamp(0.5)')
h.pop_section()
estim = h.estim

# Create a stimulus Vector
rs_exc = neuron.Vector(1000.0/g_exc)
#This is not possbile:
#rs_exc.play(estim,'rs')
#So I have to do this:
h('%s.play(&estim.rs,0.1)'%rs_exc.name)

Re: Better conductance input idiom?

Posted: Sat Aug 23, 2008 4:07 am
by csh
The following code worked fine for me:

Code: Select all

#! /usr/bin/python
from neuron import h
import numpy
h("""load_file("stdrun.hoc")""")
h.tstop = 10; h.dt = 0.01; h.steps_per_ms = 1.0/h.dt
soma = h.Section()
estim = h.SEClamp( soma(0.5) )
g_exc = numpy.arange( 10, 10+h.tstop, h.dt )
rs_exc = h.Vector()
rs_exc.from_python( 1000.0/g_exc )
rs_exc.play( estim._ref_rs, h.dt )
h.run()
The syntax is eplained here:
http://www.neuron.yale.edu/neuron/stati ... #HocObject
I have used the latest development code (rev. 2194) from the svn repository.
Best,
Christoph