recording a STATE variable with _ref_

When Python is the interpreter, what is a good
design for the interface to the basic NEURON
concepts.

Moderator: hines

Post Reply
hnakhoul
Posts: 3
Joined: Thu Jul 03, 2008 11:55 am

recording a STATE variable with _ref_

Post by hnakhoul » Thu Feb 26, 2009 6:31 pm

Dear all,
I'm running a model using NEURON as an extension to Python and attempting to record a STATE variable ("ca_i") from one of the mod files into a vector:

Code: Select all

vec = {}
vec['cai'] = h.Vector()
vec['cai'].record(soma(0.5)._ref_ca_i))
but I obtained the following error:

Code: Select all

NameError: _ref_ca_i was not made to point to anything at soma(0.5)
What should I be doing differently? I'd be very grateful for any advice.

hines
Site Admin
Posts: 1577
Joined: Wed May 18, 2005 3:32 pm

Re: recording a STATE variable with _ref_

Post by hines » Fri Feb 27, 2009 10:35 am

Code: Select all

vec['cai'].record(soma(0.5)._ref_ca_i))
perhaps you meant to write

Code: Select all

vec['cai'].record(soma(0.5)._ref_cai)
and for functions that need a currently accessed section it is often a good idea to
add it as a keyword arg as in

Code: Select all

vec['cai'].record(soma(0.5)._ref_cai, sec=soma)

hnakhoul
Posts: 3
Joined: Thu Jul 03, 2008 11:55 am

Re: recording a STATE variable with _ref_

Post by hnakhoul » Fri Feb 27, 2009 11:22 am

Dear Michael,
I tried including the accessed section as a keyword arg, but I got the same error message. I did intend ca_i and not cai (the model was written not to use NEURON's cai). I have similar difficulty recording other STATE variables defined in mod files, although other variables, like v and t, seem to record without a problem.

hines
Site Admin
Posts: 1577
Joined: Wed May 18, 2005 3:32 pm

Re: recording a STATE variable with _ref_

Post by hines » Fri Feb 27, 2009 11:33 am

Please send me the mod file and a little python file that demonstrates the problem. michael.hines@yale.edu

hines
Site Admin
Posts: 1577
Joined: Wed May 18, 2005 3:32 pm

Re: recording a STATE variable with _ref_

Post by hines » Fri Feb 27, 2009 11:38 am

Did you verify that ca_i is in fact in the soma via
print soma(.5).ca_i

hnakhoul
Posts: 3
Joined: Thu Jul 03, 2008 11:55 am

Re: recording a STATE variable with _ref_

Post by hnakhoul » Fri Feb 27, 2009 5:55 pm

I found the problem--I neglected to include the suffix of the mod file when referencing the variable. The syntax should have been

Code: Select all

vec['cai'].record(soma(0.5)._ref_ca_i_suffix,sec=soma)

Post Reply