Changeset 413

Show
Ignore:
Timestamp:
07/15/08 14:31:49 (3 months ago)
Author:
apdavison
Message:

First attempt to provide an interface for injecting arbitrary currents into cells (see #38).

Usage example:

    cell = create(IF_curr_exp)
   current_source1 = DCSource(amplitude=0.3, start=20, stop=80)
   current_source2 = StepCurrentSource(times=[20,40,60,80], amplitudes=[0.3,-0.3,0.3,0.0])

  cell.inject(current_source1)            # two alternatives
  current_source2.inject_into([cell]) 

DCSource is available in the nest2 and neuron2 modules, StepCurrentSource is only available in nest2 for the time being. It should be fairly straightforward to add ACSource and NoisyCurrentSource, etc.

Please send feedback!

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/common.py

    r411 r413  
    101101     
    102102    non_parameter_attributes = ('parent', '_cellclass', 'cellclass', 
    103                                 '_position', 'position', 'hocname', '_cell') 
     103                                '_position', 'position', 'hocname', '_cell', 
     104                                'inject') 
    104105     
    105106    def __init__(self): 
     
    203204    position = property(_get_position, _set_position) 
    204205       
    205  
    206  
     206    def inject(self, current_source): 
     207        """Inject current from a current source object into the cell.""" 
     208        current_source.inject_into([self]) 
     209         
    207210 
    208211def distance(src, tgt, mask=None, scale_factor=1.0, offset=0.0, 
  • trunk/src/nest2/__init__.py

    r412 r413  
    1515from pyNN.nest2.connectors import * 
    1616from pyNN.nest2.synapses import * 
     17from pyNN.nest2.electrodes import * 
    1718Set = set 
    1819 
  • trunk/src/neuron2/__init__.py

    r394 r413  
    1313from pyNN.neuron2.connectors import * 
    1414from pyNN.neuron2.synapses import * 
     15from pyNN.neuron2.electrodes import * 
    1516 
    1617from math import * 
  • trunk/src/neuron2/cells.py

    r403 r413  
    177177        self.insert('IF_BG5') 
    178178        self.seg.IF_BG5.surf = self.area() 
     179        self.source = neuron.NetCon(source=None, target=None, section=self, 
     180                                    position=0.5) 
    179181     
    180182    v_thresh = _new_property('seg.IF_BG5', 'Vtr')