Changeset 463
- Timestamp:
- 09/24/08 08:58:30 (2 months ago)
- Files:
-
- trunk/src/neuron2/__init__.py (modified) (1 diff)
- trunk/src/neuron2/simulator.py (modified) (3 diffs)
- trunk/src/recording.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/neuron2/__init__.py
r416 r463 733 733 f.write(line) 734 734 f.close() 735 736 # ============================================================================== 737 # Utility classes 738 # ============================================================================== 739 740 Timer = common.Timer 741 742 # ============================================================================== trunk/src/neuron2/simulator.py
r424 r463 67 67 def get(self, gather=False): 68 68 """Returns the recorded data.""" 69 if self.population: # we return indices (always starting at 0), not IDs. This is what the other modules do, but I think we should really return IDs.70 offset = self.population.first_id71 else:72 offset = 073 69 if self.variable == 'spikes': 74 70 data = numpy.empty((0,2)) … … 77 73 spikes = spikes[spikes<=state.t+1e-9] 78 74 if len(spikes) > 0: 79 new_data = numpy.array([numpy.ones(spikes.shape)* (id-offset), spikes]).T75 new_data = numpy.array([numpy.ones(spikes.shape)*id, spikes]).T 80 76 data = numpy.concatenate((data, new_data)) 81 77 elif self.variable == 'v': … … 84 80 v = id._cell.vtrace.toarray() 85 81 t = id._cell.record_times.toarray() 86 new_data = numpy.array([t, v, numpy.ones(v.shape)* (id-offset)]).T82 new_data = numpy.array([t, v, numpy.ones(v.shape)*id]).T 87 83 data = numpy.concatenate((data, new_data)) 88 84 return data trunk/src/recording.py
r462 r463 88 88 # Write header info (e.g., dimensions of the population) 89 89 if population is not None: 90 result.write("# dimensions = " + "\t".join([str(d) for d in population.dim]) + "\n")90 result.write("# dimensions = %s\n" %list(population.dim)) 91 91 result.write("# first_id = %d\n" % population.first_id) 92 92 result.write("# last_id = %d\n" % (population.first_id+len(population)-1,)) … … 149 149 if population is not None: 150 150 metadata.update({ 151 'dimensions': "\t".join([str(d) for d in population.dim]),151 'dimensions': str(list(population.dim)), 152 152 'first_id': population.first_id, 153 153 'last_id': population.first_id + len(population)-1

