Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

loading leds gives bad timestamps #73

Open
lepmik opened this issue May 24, 2024 · 6 comments
Open

loading leds gives bad timestamps #73

lepmik opened this issue May 24, 2024 · 6 comments
Assignees

Comments

@lepmik
Copy link
Member

lepmik commented May 24, 2024

x1, y1, t1, x2, y2, t2, stop_time = dl.load_leds('/projects/ec109/maria/novel-env-nwb/actions/003-010821-6/data/main.nwb')
t1[:10]
array([3909.3781351, 3909.4032681, 3909.4258424, 3909.450175 ,
       3909.4737373, 3909.497492 , 3909.5247655, 3909.545199 ,
       3909.5699786, 3909.5924168])
``
@alejoe91
Copy link
Contributor

No that's correct. It uses the actual open ephys timestamps, which are not zeroed ;)

@lepmik
Copy link
Member Author

lepmik commented Jun 12, 2024

We need to zero timestamps for both tracking and spike times, for spike times its essential to subtract the actual start time

@alejoe91
Copy link
Contributor

@lepmik you can use the nwbfile.session_start_time. All times in the NWB file (units, tracking, trials) are relative to this start time

@lepmik
Copy link
Member Author

lepmik commented Jun 14, 2024

fixed in 991f7fd

@lepmik lepmik closed this as completed Jun 14, 2024
@lepmik lepmik reopened this Jun 14, 2024
@lepmik
Copy link
Member Author

lepmik commented Jun 14, 2024

nwbfile.session_start_time is a datetime, using the .timestamp() seems to give wildly wrong times. Can you please provide the right format to subtract the session_start_time from the times obtained from spikeinterface?

@alejoe91
Copy link
Contributor

I see. So the session_start_time is taken from the action.datetime..

Then you should use the starting time of nwbfile["acquisition/EelctricalSeries"].starting_time

If you have the spikeinterface Recording, you can do: recording.get_times()[0]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants