Page 1 of 1

Can't we write tautable.hoc in Python?

Posted: Fri May 24, 2024 3:36 am
by mi2n
I wonder if we still need to write tautables in hoc, then include in the python script? For example, for the following hoc script:

Code: Select all

// Tautable for KIR channel
objref vecv_KIR, vecmtau_KIR
vecv_KIR = new Vector()
vecv_KIR.indgen(-100, 0, 10) // -100 to 0 with steps of 10

vecmtau_KIR = new Vector()
vecmtau_KIR.append(14.93, 16.00, 18.87, 21.51, 24.24, 27.59, 30.77, 28.57, 23.53, 17.78, 16.00)

table_tabmtau_KIR(&vecmtau_KIR.x[0], vecv_KIR.size, &vecv_KIR.x[0])
Do we have an equivalent python script using Python's NEURON module, which works with the KIR.mod file and allow FUNCTION_TABLE creation?

Code: Select all

: in KIR.mod file
FUNCTION_TABLE tabmtau(v(mV)) (ms)
Sorry if this has been discussed before, I couldn't find anything with a quick search.

Re: Can't we write tautable.hoc in Python?

Posted: Fri May 24, 2024 12:02 pm
by ted
Sure, if you want to rewrite those statements in Python, go ahead. Here's a seed to get you started. I have even corrected the comment in the second statement.

Code: Select all

vecv_KIR = h.Vector()
vecv_KIR.indgen(-100, 0, 10) # -100 to 0 with steps of 10

Re: Can't we write tautable.hoc in Python?

Posted: Mon Jul 01, 2024 2:27 am
by mi2n
But I can't find a python statement equivalent to the following HOC statement:

Code: Select all

 table_tabmtau_KIR(&vecmtau_KIR.x[0], vecv_KIR.size, &vecv_KIR.x[0])