Skip to content

Commit 74811f0

Browse files
author
Jacob Pennington
committed
Added empty spike check in swarmsplitter.check_CCG
1 parent 1a74f14 commit 74811f0

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

kilosort/swarmsplitter.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ def bimod_score(xproj):
5353
def check_CCG(st1, st2=None, nbins = 500, tbin = 1/1000):
5454
if st2 is None:
5555
st2 = st1.copy()
56-
K , T= compute_CCG(st1, st2, nbins = nbins, tbin = tbin)
56+
K , T = compute_CCG(st1, st2, nbins = nbins, tbin = tbin)
57+
if len(st1) == 0 or len(st2 == 0) or T == 0:
58+
return False, False
5759
R12, Q12, Q00 = CCG_metrics(st1, st2, K, T, nbins = nbins, tbin = tbin)
5860
is_refractory = R12<.1 and (Q12<.2 or Q00<.25)
5961
cross_refractory = R12<.25 and (Q12<.05 or Q00<.25)

0 commit comments

Comments
 (0)