best way to Vector.record()?
Posted: Mon Apr 21, 2008 9:34 pm
I'm looking to run rather simple simulations in NEURON + Python. I have the python code that generates a geometric description of the cell and I just need to be able to translate that into a NEURON model cell (easy enough in hoc). I can get the model translated (I think) but recording a variable for post-processing is not working for me. For example:
I'd like to know what you think is the best way to gain access to a recorded variable in python. Since the rest of my project is in python, I'd hate to have to export geometries to files and import them in a .hoc file (just scripting neuron). I hope I've made sense. If recording a simulation variable into a python list or numpy array is going to be hard, am I better off just scripting neuron?
Code: Select all
[8:25pm]@Sakurai:~/dendritetics/code>nrniv -python
NEURON -- VERSION 6.2.1002 (2037) 2008-03-26
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2007
See http://www.neuron.yale.edu/credits.html
>>> from neuron import *
>>> from nrn import *
>>> soma = Section()
>>> v = Vector()
>>> soma
<nrn.Section object at 0x258c040>
>>> v
0 0 0 0 0
0 0 0 0 0
>>> v.record( soma(0.5).v )
bad stack access: expecting (double *); really (double)
nrniv: interpreter stack type error
near line 7
v.record( soma(0.5).v )
^
Vector[0].record(-65)
oc_restore_code tobj_count=1 should be 0
Traceback (most recent call last):
File "stdin", line 1, in ?
RuntimeError: hoc error
>>>