Skip to content

Commit

Permalink
fixes main bug for issue #594
Browse files Browse the repository at this point in the history
  • Loading branch information
marius10p committed Mar 8, 2024
1 parent 80d0062 commit 10dce58
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions mainLoop/trackAndSort.m
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,10 @@
% loading a single batch (same as everywhere)
offset = 2 * ops.Nchan*batchstart(k);
fseek(fid, offset, 'bof');
dat = fread(fid, [ops.Nchan NT + ops.ntbuff], '*int16');
%dat = fread(fid, [ops.Nchan NT + ops.ntbuff], '*int16');
% spike holes bug issue #594, location 1/2
dat = fread(fid, [ops.Nchan NT], '*int16');

dat = dat';
dataRAW = single(gpuArray(dat))/ ops.scaleproc;
Params(1) = size(dataRAW,1);
Expand Down Expand Up @@ -174,7 +177,15 @@
% of the raw data at this time

% we carefully assign the correct absolute times to spikes found in this batch
toff = nt0min + t0 + NT*(k-1);

% toff = nt0min + t0 + NT*(k-1);
% spike holes bug issue #594, location 2/2
ioffset = ops.ntbuff;
if k==1
ioffset = 0; % the first batch is special (no pre-buffer)
end
toff = nt0min + t0 -ioffset + (NT-ops.ntbuff)*(k-1);

st = toff + double(st0);

irange = ntot + [1:numel(x0)]; % spikes and features go into these indices
Expand Down

0 comments on commit 10dce58

Please sign in to comment.