Add probe utility functions for export and location queries#7
Merged
Conversation
…location Port three functions from NDI-matlab's +ndi/+fun/+probe/ package: - export_binary: exports a single probe's timeseries data to an int16 binary file - export_all_binary: batch exports all n-trode probes to kilosort-compatible binaries - location: finds probe_location documents by traversing the underlying_element tree The ndi.fun.probe subpackage is registered in ndi.fun.__init__ so that ndi.fun.probe.* is importable. https://claude.ai/code/session_01U7Zn3csCPw6VJyMNfF59dz
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a new
ndi.fun.probemodule with utility functions for exporting probe data to binary files and querying probe location documents. These functions provide Python equivalents to existing MATLAB functionality.Key Changes
New module
ndi.fun.probe: Created with three main functions:export_binary(): Exports probe data to binary files with metadata, supporting configurable precision and scalingexport_all_binary(): Batch exports all n-trode probes in a session to a kilosort-compatible directory structurelocation(): Traverses element dependency trees to find associated probe objects and their location documentsImplementation details:
export_binary()processes data in 100-second chunks to manage memory efficientlyint16)export_all_binary()creates organized subdirectories for each probe with safe naming (spaces replaced with underscores)location()handles both element objects and string identifiers, with proper dependency resolutionModule integration: Updated
ndi.fun.__init__.pyto expose the newprobesubmodule and updated docstring to reflect new functionalityNotable Implementation Details
.metadataextension) are created alongside binary files with epoch information and scaling parametersexport_all_binary()is1/0.195for Intan data compatibilityhttps://claude.ai/code/session_01U7Zn3csCPw6VJyMNfF59dz