diff options
author | Mario Mulansky <mario.mulansky@gmx.net> | 2015-05-11 17:54:02 +0200 |
---|---|---|
committer | Mario Mulansky <mario.mulansky@gmx.net> | 2015-05-11 17:54:02 +0200 |
commit | a35402c208bd0ad31e5e60b6ddc55a3470e7bdde (patch) | |
tree | 1eca443c3b692c55438dd81b5f96cce51c8f4338 /pyspike/cython/cython_profiles.pyx | |
parent | bec2529367f1bdd5dac6d6fbaec560a30feec3c7 (diff) |
bugfix: spike_sync=1 for empty spike trains
Diffstat (limited to 'pyspike/cython/cython_profiles.pyx')
-rw-r--r-- | pyspike/cython/cython_profiles.pyx | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/pyspike/cython/cython_profiles.pyx b/pyspike/cython/cython_profiles.pyx index d937a02..f9893eb 100644 --- a/pyspike/cython/cython_profiles.pyx +++ b/pyspike/cython/cython_profiles.pyx @@ -416,9 +416,13 @@ def coincidence_profile_cython(double[:] spikes1, double[:] spikes2, 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 |