Changeset 384

Show
Ignore:
Timestamp:
06/21/08 09:29:19 (5 months ago)
Author:
pierre
Message:

Enhancement of the rough getSubPopulation() method, that seems to be working at some point. Still experimental

Files:

Legend:

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

    r383 r384  
    918918        # And then copy parameters from its parent 
    919919        pop.cellparams  = self.cellparams 
    920         pop.cell        = cell_list 
    921920        pop.first_id    = self.first_id 
    922         idx             = pop.cell.flatten() -pop.first_id 
     921        idx             = numpy.array(cell_list).flatten() - pop.first_id 
     922        pop.cell        = self.cell.flatten()[idx].reshape(dims) 
    923923        pop.cell_local  = self.cell_local[idx] 
    924         pop.position    = self.positions[:,idx] 
     924        pop.positions   = self.positions[:,idx] 
    925925        return pop 
     926 
     927 
    926928 
    927929 
  • trunk/test/IF_cond_alpha.py

    r341 r384  
    1919 
    2020 
    21 setup(timestep=0.01,min_delay=0.01,max_delay=4.0) 
     21setup(timestep=0.1,min_delay=0.1,max_delay=4.0) 
    2222 
    2323ifcell = create(IF_cond_alpha, {'i_offset' : 0.1,    'tau_refrac' : 3.0, 
  • trunk/test/IF_cond_exp.py

    r341 r384  
    1919 
    2020 
    21 setup(timestep=0.01,min_delay=0.01,max_delay=4.0) 
     21setup(timestep=0.1,min_delay=0.1,max_delay=4.0) 
    2222 
    2323ifcell = create(IF_cond_exp, {  'i_offset' : 0.1,    'tau_refrac' : 3.0, 
  • trunk/test/VAbenchmarks.py

    r317 r384  
    3838rngseed  = 98765 
    3939 
    40 n        = 4000  # number of cells 
     40n        = 400  # number of cells 
    4141r_ei     = 4.0   # number of excitatory cells:number of inhibitory cells 
    4242pconn    = 0.02  # connection probability 
  • trunk/test/simple_STDP.py

    r341 r384  
    1313if hasattr(sys,"argv"):     # run using python 
    1414    simulator = sys.argv[-1] 
    15 else: 
    16     simulator = "neuron" 
     15    print simulator 
     16#else: 
     17#    simulator = "neuron" 
    1718    #simulator = "neuron"    # run using nrngui -python 
    1819 
     
    4344#print prj.getWeights() 
    4445t = 0 
    45 while t < 50: 
    46     t = run(1.0) 
    47     syn_dict = nest.GetConnection([p1[0]], 'stdp_synapse', 0) 
    48     print "%4.1f   %6.4f   %7.3f   %6.4f" % (t, prj.getWeights()[0], syn_dict['Kplus'], syn_dict['weight']) 
     46if simulator == "nest2": 
     47    while t < 50: 
     48        t = run(1.0) 
     49        syn_dict = nest.GetConnection([p1[0]], 'stdp_synapse', 0) 
     50        print "%4.1f   %6.4f   %7.3f   %6.4f" % (t, prj.getWeights()[0], syn_dict['Kplus'], syn_dict['weight']) 
    4951#run(1000.0) 
    5052p1.printSpikes("simple_STDP_1.ras")