Skip to content

Commit

Permalink
Added sorting of the spike times after dithering (#105)
Browse files Browse the repository at this point in the history
Thanks for the fix!
  • Loading branch information
pietroquaglio authored and alperyeg committed May 9, 2017
1 parent 0e91a50 commit 020af89
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion elephant/spike_train_surrogates.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def dither_spikes(spiketrain, dither, n=1, decimals=None, edges=True):
# Leave out all spikes outside [spiketrain.t_start, spiketrain.t_stop]
tstart, tstop = (spiketrain.t_start / spiketrain.units).base, \
(spiketrain.t_stop / spiketrain.units).base
surr = [s[np.all([s >= tstart, s < tstop], axis=0)] * spiketrain.units
surr = [np.sort(s[np.all([s >= tstart, s < tstop], axis=0)]) * spiketrain.units
for s in surr.base]

# Return the surrogates as SpikeTrains
Expand Down

0 comments on commit 020af89

Please sign in to comment.