Changeset 314
- Timestamp:
- 11/10/08 15:01:55 (2 months ago)
- Files:
-
- trunk/src/signals.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/signals.py
r313 r314 308 308 return numpy.std(isi)/numpy.mean(isi) 309 309 else: 310 print "Warning, a CV can't be computed because there are not enough spikes"311 return n an310 logging.debug("Warning, a CV can't be computed because there are not enough spikes") 311 return numpy.nan 312 312 313 313 def fano_factor_isi(self): … … 1125 1125 1126 1126 1127 def cv_isi(self ):1127 def cv_isi(self, float_only=False): 1128 1128 """ 1129 1129 Return the list of all the cv coefficients for all the SpikeTrains objects 1130 within the SpikeList. 1131 1130 within the SpikeList. Return NaN when not enough spikes are present 1131 1132 Inputs: 1133 float_only - False by default. If true, NaN values are automatically 1134 removed 1135 1136 Examples: 1137 >> spklist.cv_isi() 1138 [0.2,0.3,Nan,2.5,Nan,1.,2.5] 1139 >> spklist.cv_isi(True) 1140 [0.2,0.3,2.5,1.,2.5] 1141 1132 1142 See also: 1133 1143 cv_isi_hist, cv_local, cv_kl 1134 1144 """ 1135 cvs_isi = numpy.empty(self.N)1145 cvs_isi = [] 1136 1146 for id in self.id_list(): 1137 cvs_isi[id] = self.spiketrains[id].cv_isi() 1147 cvs_isi.append(self.spiketrains[id].cv_isi()) 1148 cvs_isi = numpy.array(cvs_isi) 1149 if float_only: 1150 cvs_isi = numpy.extract(numpy.logical_not(numpy.isnan(cvs_isi)),cvs_isi) 1138 1151 return cvs_isi 1139 1152 … … 1158 1171 cv_isi, cv_local, cv_kl 1159 1172 """ 1160 cvs = numpy.array(self.cv_isi())1173 isi = self.cv_isi(float_only=True) 1161 1174 if newnum: 1162 1175 values, xaxis = numpy.histogram(cvs, bins=bins, normed=True, new=newnum)

