catalystneuro / IBL-to-nwb

Conversion of IBL data to NWB format.
BSD 3-Clause "New" or "Revised" License
2 stars 3 forks source link

CN TODO: Correct raw timestamps #63

Open CodyCBakerPhD opened 2 weeks ago

CodyCBakerPhD commented 2 weeks ago

SpikeSortingLoader has a method that gives a mapping from frame indices in raw recording to timestamps used for spike sorting, etc.

Maybe Mayo can send explicit code

CodyCBakerPhD commented 4 days ago

@mayofaulkner Would you be so kind as to copy/paste a code segment here showing how to get the synchronized frame to global timestamp mapping?

mayofaulkner commented 2 days ago

Here is a snippet that shows how you can get the raw data timestamps

from brainbox.io.one import SpikeSortingLoader
from one.api import ONE
import numpy as np
one = ONE()
ssl = SpikeSortingLoader(pid=pid, one=one)
sr_ap = ssl.raw_electrophysiology(band="ap", stream=True)
sr_times = ssl.samples2times(np.arange(0, sr_ap.ns), direction='forward')