cortex-lab / PinkRigs

Shared code for processing data on the pink rigs
3 stars 1 forks source link

try2alignVectors suboptimal #28

Closed takacsflora closed 1 year ago

takacsflora commented 1 year ago

Example recording: zaru/Subjects/AV024/2022-10-11/5

When the difference is in the first flip of the photodiode, the try2alignVector is throwing away flips unnecessarily?

So in this particular recording:

if (length(blockRefTimes)-length(timelineRefTimes))==1
       truncated_block = blockRefTimes(2:end);
end
sum((diff(truncated_block)-diff(timelineRefTimes))>0.25)==0

is True.

and this results in 5278 flips.

while [timelineRefTimes, blockRefTimes] = try2alignVectors(timelineRefTimes,blockRefTimes,0.25,1); would result in 5276 flips.

I don't understand why there should be this difference, and if try2AlignVectors could minimise the flips it throws away?

Nb. I know that in some recordings its good to throw away many flips to make sure the flips you align with is true. But in sparseNoise, I try to throw away any square flip that could not be well aligned.

pipcoen commented 1 year ago

Discussed this. I don't think it's an issue, but please let me know if you think it needs revisiting