You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When reading samples from signals the current implementation is a bit quirky and deviates from expectations when reading memory mapped samples from a file IF those samples need to be scaled.
Consider the case where we read the sigmf logo from the main repository. This is a 2-channel real-valued audio file with samples stored as 16-bit integers.
Hi @Teque5, I've run into the same kind of problem with sigmf archives... I was hoping #42 was going to fix this, but no..
On my end the problem is that functions like read_samples_in_capture() assume that we have a data_file to access to run things like os.path.getsize(). IMO it would be really nice to rework/consolidate SigMFFile.__init__, set_data_file(), and _read_datafile() to process user inputs (either a file, a buffer, any other type, ...) into a single internal representation of the data (maybe _memmap?). Then, each accessor can use that single "representation" and return whatever is needed.
This might also help support loading a non-conforming dataset?
Let me know what you think, I don't have a lot of time to spare on this, but I could try to help out.
When reading samples from signals the current implementation is a bit quirky and deviates from expectations when reading memory mapped samples from a file IF those samples need to be scaled.
Consider the case where we read the sigmf logo from the main repository. This is a 2-channel real-valued audio file with samples stored as 16-bit integers.
This happens because when using read_samples the scale factor is applied, but this is not done for the memory map.
I'm not sure the exact best solution for this, but I think we should fix #15 simultaneously since it will require tinkering with the same code.
Solutions I propose:
read_samples
probably)Fixing #15 I believe requires using the
offset
kwarg ofnp.memmap
.The text was updated successfully, but these errors were encountered: