Read uint64 sample counts from hdr files#242
Open
robrui wants to merge 3 commits into
Open
Conversation
The batched file sink now writes tag sample counts as uint64_t instead of float32. Update the Python reader to parse the new 12-byte-per-entry format. Companion to spectregrams/gr-spectre#24.
5 tasks
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.
What does this PR do?
Update the _HdrFile reader to parse the new binary format where sample counts are stored as uint64_t instead of float32.
The initial implementation used
np.frombufferwithoffset=which reads continuously through the buffer, ignoring the 12-byte entry boundary. Fixed to use a structurednp.dtypeso each[value_float32, nsamples_uint64]entry is parsed correctly.Issue link
#209
Checklist before merging
Additional notes
Companion to spectregrams/gr-spectre#24 which fixes the float32 overflow in the batched file sink. A local test script (3 cases: normal values, large sample count >2^24, extra bytes truncation) was verified against the new reader logic. The full pytest suite requires hardware-specific GNU Radio modules (gnuradio.sdrplay3) which are not available in the test environment.