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

Packing openephys files into .dat #23

Open
jofrony opened this issue Jul 13, 2023 · 2 comments
Open

Packing openephys files into .dat #23

jofrony opened this issue Jul 13, 2023 · 2 comments

Comments

@jofrony
Copy link

jofrony commented Jul 13, 2023

Hi,

I am using Open Ephys with Neuronexus probes. We have previously used the archive code to pack our Open Ephys files into .dat file which is required by Kilosort. Is this function available in these tools or are there other ways to do it?

@medengineer
Copy link
Member

Hi,

Yes, you just need to load the continuous[0].samples and call np.tofile on that array.

@jsiegle
Copy link
Member

jsiegle commented Jul 13, 2023

For example, for the data in the first data stream saved by the first record node, this is the code you'd need:

from open_ephys.analysis import Session

session = Session('/path/to/data/directory')
data = session.recordnodes[0].recordings[0].continuous[0].samples
data = data.astype('int16') # convert to 16-bit integers before export
data.tofile('continuous.dat') # write samples to a .dat file

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

3 participants