diff options
author | Mario Mulansky <mario.mulansky@gmx.net> | 2015-05-18 15:29:41 +0200 |
---|---|---|
committer | Mario Mulansky <mario.mulansky@gmx.net> | 2015-05-18 15:29:41 +0200 |
commit | d985f3a8de6ae840c8a127653b3d9affb1a8aa40 (patch) | |
tree | fc583b16d030b6ba67cf09895fd269bd297ad660 /pyspike/cython/python_backend.py | |
parent | a718911ba2aac9302465c0522cc18b4470b99f77 (diff) | |
parent | 2b957ac5d7c964b6fe0e99bb078a396732331869 (diff) |
Merge branch 'develop'0.3.0
Diffstat (limited to 'pyspike/cython/python_backend.py')
-rw-r--r-- | pyspike/cython/python_backend.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/pyspike/cython/python_backend.py b/pyspike/cython/python_backend.py index 1fd8c42..69a420f 100644 --- a/pyspike/cython/python_backend.py +++ b/pyspike/cython/python_backend.py @@ -340,7 +340,7 @@ def cumulative_sync_python(spikes1, spikes2): def coincidence_python(spikes1, spikes2, t_start, t_end, max_tau): def get_tau(spikes1, spikes2, i, j, max_tau): - m = 1E100 # some huge number + m = t_end - t_start # use interval as initial tau if i < len(spikes1)-1 and i > -1: m = min(m, spikes1[i+1]-spikes1[i]) if j < len(spikes2)-1 and j > -1: @@ -399,10 +399,14 @@ def coincidence_python(spikes1, spikes2, t_start, t_end, max_tau): st[0] = t_start st[len(st)-1] = t_end - c[0] = c[1] - c[len(c)-1] = c[len(c)-2] - mp[0] = mp[1] - mp[len(mp)-1] = mp[len(mp)-2] + if N1 + N2 > 0: + c[0] = c[1] + c[len(c)-1] = c[len(c)-2] + mp[0] = mp[1] + mp[len(mp)-1] = mp[len(mp)-2] + else: + c[0] = 1 + c[1] = 1 return st, c, mp |