Exemple #1
0
 def slice_spikes(self, spikes):
     # from standard structure to standard structure
     sliced_spikes = []
     slice_length = self.sliced_steps*self.dt
     for (i,t) in spikes:
         slice = int(t/slice_length)
         newt = self.overlap + (t % slice_length)*second
         newi = i + self.groups*slice
         sliced_spikes.append((newi, newt)) 
     sliced_spikes = sort_spikes(sliced_spikes)
     return sliced_spikes
Exemple #2
0
 def slice_spikes(self, spikes):
     # from standard structure to standard structure
     sliced_spikes = []
     slice_length = self.sliced_steps * self.dt
     for (i, t) in spikes:
         slice = int(t / slice_length)
         newt = self.overlap + (t % slice_length) * second
         newi = i + self.groups * slice
         # discard unreachable spikes
         if newi >= (self.slices * self.groups): continue
         sliced_spikes.append((newi, newt))
     sliced_spikes = sort_spikes(sliced_spikes)
     return sliced_spikes
Exemple #3
0
    def slice_spikes(self, spikes):
        # slice the spike trains into different chunks and assign new index
        sliced_spikes = []
        slice_length = self.sliced_steps*self.dt
#        print self.groups,self.slices, slice_length
        for (i,t) in spikes:
            slice = int(t/slice_length)
            newt = self.overlap + (t % slice_length)*second
            newi = i + self.groups*slice
#            print i,t,slice,newt,newi
            # discard unreachable spikes
            if newi >= (self.slices*self.groups): continue
            sliced_spikes.append((newi, newt)) 
        sliced_spikes = sort_spikes(sliced_spikes)
        return sliced_spikes