File: cell.py

package info (click to toggle)
neuron 8.2.6-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 34,760 kB
  • sloc: cpp: 149,571; python: 58,465; ansic: 50,329; sh: 3,510; xml: 213; pascal: 51; makefile: 35; sed: 5
file content (29 lines) | stat: -rw-r--r-- 649 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from neuron import h
import math


class Cell:
    def __init__(self):
        soma = h.Section(name="soma", cell=self)
        dend = h.Section(name="dend", cell=self)
        dend.connect(soma)

        soma.nseg = 1
        soma.L = 10
        soma.diam = 100.0 / soma.L / math.pi
        soma.insert("hh")

        dend.nseg = 25
        dend.L = 1000
        dend.diam = 2
        dend.insert("hh")
        for seg in dend:
            seg.hh.gnabar /= 2
            seg.hh.gkbar /= 2
            seg.hh.gl /= 2

        self.dend = dend
        self.soma = soma
        for sec in [soma, dend]:
            sec.Ra = 100
            sec.cm = 1