Skip to content

Commit 2483eb1

Browse files
fixed whitening matrix inv for phy
1 parent 0983fef commit 2483eb1

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

kilosort/io.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,9 @@ def save_to_phy(st, clu, tF, Wall, probe, ops, imin, results_dir=None,
158158
# whitening matrix ** saving real whitening matrix doesn't work with phy currently
159159
whitening_mat = ops['Wrot'].cpu().numpy()
160160
np.save((results_dir / 'whitening_mat_dat.npy'), whitening_mat)
161-
whitening_mat = 0.005 * np.eye(len(chan_map), dtype='float32')
161+
# NOTE: commented out for reference, this was different in KS 2.5 because
162+
# the binary file was already whitened.
163+
# whitening_mat = 0.005 * np.eye(len(chan_map), dtype='float32')
162164
whitening_mat_inv = np.linalg.inv(whitening_mat + 1e-5 * np.eye(whitening_mat.shape[0]))
163165
np.save((results_dir / 'whitening_mat.npy'), whitening_mat)
164166
np.save((results_dir / 'whitening_mat_inv.npy'), whitening_mat_inv)

0 commit comments

Comments
 (0)