Skip to content

Commit 79a2e8b

Browse files
author
Jacob Pennington
committed
Added option to specify tmax for benchmark comparisons
1 parent 0bab72a commit 79a2e8b

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

kilosort/bench.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,12 +162,18 @@ def compare_recordings(st_gt, clu_gt, yclu_gt, st_new, clu_new, yclu_new):
162162
return fmax, fmiss, fpos, best_ind, matched_all, top_inds
163163

164164

165-
def load_GT(filename, ops, gt_path, toff = 20, nmax = 600):
165+
def load_GT(filename, ops, gt_path, toff=20, nmax=600, tmax=None):
166166
#gt_path = os.path.join(ops['data_folder'] , "sim.imec0.ap_params.npz")
167167
dd = np.load(gt_path, allow_pickle = True)
168168

169169
st_gt = dd['st'].astype('int64')
170170
clu_gt = dd['cl'].astype('int64')
171+
172+
if tmax is not None:
173+
imax = int(tmax * ops['fs'])
174+
idx = st_gt < imax
175+
st_gt = st_gt[idx]
176+
clu_gt = clu_gt[idx]
171177

172178
ix = clu_gt<nmax
173179
st_gt = st_gt[ix]

0 commit comments

Comments
 (0)