denisecailab / ezTrack

Free, platform independent, behavior tracking software.
GNU General Public License v3.0
118 stars 41 forks source link

1 second bins in freezing module #64

Closed sarogers9 closed 1 year ago

sarogers9 commented 1 year ago

Hi there! If I want the program to output freezing data in 1 second bins for a 45 minute session, is there a better way to do this than manually writing in the frames I need in the summary report module? That would lead to 81,000 lines of code lol!

sarogers9 commented 1 year ago

never mind - i figured out how to print the freezing variable frame by frame into a csv file :) (sorry, i'm not too familiar with python. thanks!)

ZachPenn commented 1 year ago

You could also look into doing a dictionary comprehension for this. The following would provide the bins you want. Just update the fps for your situation.

fps = 30
session_secs = 45*60
bin_dict = {sec: (sec*fps, (sec+1)*fps) for sec in np.arange(session_secs)}