summaryrefslogtreecommitdiff
path: root/pyspike/cython/cython_profiles.pyx
diff options
context:
space:
mode:
Diffstat (limited to 'pyspike/cython/cython_profiles.pyx')
-rw-r--r--pyspike/cython/cython_profiles.pyx12
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