Changeset 1053

Show
Ignore:
Timestamp:
01/31/12 12:23:49 (4 months ago)
Author:
pierre
Message:

Patch to allow the user to use the accumulator mode of the new NEST versions. This is a hidden trick for the user, but maybe this could be an option of the recording devices. Nothing is change in the current behaviour of pyNN.nest.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/nest/recording.py

    r1029 r1053  
    8383        Numpy array. 
    8484        """ 
    85         ids = events['senders'] 
     85        if events.has_key('senders'): 
     86            ids = events['senders'] 
     87        else: 
     88            ## That mean that we are using the accumulator mode of NEST ## 
     89            ids = list(self._all_ids)[0] * numpy.ones(len(events['times'])) 
    8690        times = events['times'] 
    8791        if self.type == 'spike_detector': 
     
    9094            data = [ids, times] 
    9195            for var in self.record_from: 
    92                 data.append(events[var]) 
    93             data = numpy.array(data).T 
     96                if events.has_key('senders'): 
     97                    data.append(events[var]) 
     98                else: 
     99                    data.append(events[var]/len(self._all_ids)) 
     100            data = numpy.array(data).T   
    94101        return data 
    95102