Add clock_times and clock_values to stream dictionary #105
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.
"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.