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

Add clock_times and clock_values to stream dictionary #105

Merged
merged 2 commits into from
Apr 26, 2024

Conversation

expensne
Copy link
Contributor

"Clock offsets" are a feature defined in the XDF specification, detailed here. However, they are not directly accessible when loading XDF contents with pyxdf. These offsets are being used to synchronize clocks within the function _clock_sync, as seen here. Unfortunately, the original values used in these functions are not exposed outside of pyxdf, making it impossible to retrieve them.

When utilizing LabRecorder, these values are conveniently accessible within the footer, under "info" > "clock_offsets". This accessibility is due to LabRecorder internally storing the original clock offset data, which is then included in the footer. The process of writing the offset data into the specified chunk in the XDF spec can be found here. Notably, the offset data is stored in a vector and later retrieved to populate the footer, as shown here.

The redundancy in storing and retrieving offset data appears unnecessary. Hence, I propose exposing the original offset values via the stream dictionary returned by pyxdf. This becomes particularly relevant for us, given that we've developed our own recording software in line with XDF specifications, rather than relying on LabRecorder. Despite this, we're eager to access offset data through pyxdf without resorting to redundant duplication in the footer.

@cbrnr
Copy link
Contributor

cbrnr commented Apr 26, 2024

No objections, could you please add a changelog entry?

@expensne
Copy link
Contributor Author

expensne commented Apr 26, 2024

No objections, could you please add a changelog entry?

Sure, done.

@cbrnr cbrnr merged commit 99dfccf into xdf-modules:main Apr 26, 2024
@cbrnr
Copy link
Contributor

cbrnr commented Apr 26, 2024

Thanks @expensne!

@expensne expensne mentioned this pull request Jul 17, 2024
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

Successfully merging this pull request may close these issues.

2 participants