Changeset 462
- Timestamp:
- 09/19/08 08:29:29 (2 months ago)
- Files:
-
- trunk/src/nest2/__init__.py (modified) (6 diffs)
- trunk/src/recording.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/nest2/__init__.py
r458 r462 154 154 nest.SetSynapseContext(original_synapse_context) 155 155 156 def get(self, gather=False ):156 def get(self, gather=False, compatible_output=True): 157 157 """Returns the recorded data.""" 158 158 if self._device is None: … … 171 171 elif nest.GetStatus(self._device,'to_memory')[0]: 172 172 data = nest.GetStatus(self._device,'events')[0] 173 data = recording.convert_compatible_output(data, self.population, self.variable )173 data = recording.convert_compatible_output(data, self.population, self.variable,compatible_output) 174 174 return data 175 175 … … 903 903 self.recorders['spikes'].write(filename, gather, compatible_output) 904 904 905 def getSpikes(self, gather=True ):905 def getSpikes(self, gather=True, compatible_output=True): 906 906 """ 907 907 Return a 2-column numpy array containing cell ids and spike times for … … 913 913 because they mangle simulator recorder files. 914 914 """ 915 return self.recorders['spikes'].get(gather )916 917 def get_v(self, gather=True ):915 return self.recorders['spikes'].get(gather, compatible_output) 916 917 def get_v(self, gather=True, compatible_output=True): 918 918 """ 919 919 Return a 2-column numpy array containing cell ids and spike times for … … 925 925 because they mangle simulator recorder files. 926 926 """ 927 return self.recorders['v'].get(gather )927 return self.recorders['v'].get(gather, compatible_output) 928 928 929 def get_c(self, gather=True ):929 def get_c(self, gather=True, compatible_output=True): 930 930 """ 931 931 Return a 2-column numpy array containing cell ids and spike times for … … 937 937 because they mangle simulator recorder files. 938 938 """ 939 return self.recorders['conductance'].get(gather )939 return self.recorders['conductance'].get(gather, compatible_output) 940 940 941 941 def meanSpikeCount(self, gather=True): trunk/src/recording.py
r444 r462 47 47 logging.warning("File %s already exists. Renaming the original file to %s_old" % (filename, filename)) 48 48 49 def convert_compatible_output(data, population, variable ):49 def convert_compatible_output(data, population, variable,compatible_output=True): 50 50 """ 51 51 !!! NEST specific !!! … … 59 59 return numpy.array((data['times'],data['senders']- padding)).T 60 60 elif variable == 'v': 61 return numpy.array((data['times'],data['senders']- padding,data['potentials'])).T 61 if compatible_output: 62 return numpy.array((data['potentials'],data['senders']- padding)).T 63 else: 64 return numpy.array((data['times'],data['senders']- padding,data['potentials'])).T 62 65 elif variable == 'conductance': 63 return numpy.array((data['times'],data['senders']- padding,data['exc_conductance'],data['inh_conductance'])).T 66 if compatible_output: 67 return numpy.array((data['exc_conductance'],data['inh_conductance'],data['senders']- padding)).T 68 else: 69 return numpy.array((data['times'],data['senders']- padding,data['exc_conductance'],data['inh_conductance'])).T 64 70 65 71

