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

SigMF archive error reading data file #244

Closed
Deschain opened this issue Sep 15, 2022 · 4 comments · Fixed by #264
Closed

SigMF archive error reading data file #244

Deschain opened this issue Sep 15, 2022 · 4 comments · Fixed by #264

Comments

@Deschain
Copy link

I think that there is an error opening sigmf archive files. The compliant dataset file is no recognized as a valid file because the relative path of the tar member is used https://github.com/gnuradio/SigMF/blob/1eef44a67636ab15078e7eecc00144b9e18cdaa3/sigmf/sigmffile.py#L779

@lgoix
Copy link

lgoix commented Nov 30, 2022

dir = tempfile.mkdtemp()
dir is created before, we could pass it to the get_dataset_filename_from_metadata()

@jacobagilbert
Copy link
Member

@gmabey - you are our resident expert on Archives, can you take a look at this issue in the latest codebase?

@gmabey
Copy link
Contributor

gmabey commented Dec 28, 2022

@Deschain Yes, you are correct, there is a true problem with the current implementation. Unfortunately, my best suggestion right now is to use SigMFArchiveReader instead, like this:

import sigmf
rdr = sigmf.SigMFArchiveReader('/the/path/to.sigmf')
print(rdr.sigmffile)
print(rdr.shape)  # the shape of the datafile
print(rdr[:])  # accessing values in the datafile

@jacobagilbert do you think that SigMFFile.fromfile() should be deprecated?

@jacobagilbert
Copy link
Member

I think we can fix this so that fromfile() can open all types including archives. Its used a lot.

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 a pull request may close this issue.

4 participants