Post-hoc tracking time issues
Problem
Currently post-hoc tracking works very similar to online tracking: The pre_experiment module finds the animal before handing tracking over to fast_tracking.
During animal detection there is a lag as the animal is almost never detected in the first frame. In addition I have introduced a 1 second lag to improve detection.
Problem: When doing presenting time-dependent stimulus the frame number between the tracked data.csv and the frame number of the video are not aligned anymore.
For example: If it take 5 seconds at 15fps to detect the animal 75 frames, tracking will only happen after 75 frames. In fast_tracking the counter starts again at zero (makes no sense to change this because of real-time tracking).
If I present time dependent stimulus after 5 seconds (at frame 75) the frame where the animal experiences the stimulus in tracked is at frame 0.
This is all very confusing and I probably don't want the user to deal with any of these details.
Solution
The best way would be to keep the time dependent stimulus file frame number identical to the tracked data.csv frame numbers. This will lead to having a bunch of zeros at the beginning of the data.csv in post-hoc tracked experiments but it will keep time intact.