-
-
Notifications
You must be signed in to change notification settings - Fork 16
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
Does the data block needs to be binary? #118
Comments
Thanks for the feedback. Unfortunately, there is not an elegant way to save arrays inside yaml and I would strongly encourage you to not attempt saving "too big" as it can make reading the asdf file quite slow. However, the inline arrays have been designed so that they can be easily parsable by any yaml parser. As for your main request could you provide me with minimal code example which produces an example of a small (just a few rows) |
Could you also clarify what you mean by human readable? Just because a block can contain binary doesn't preclude the contents being simple text in principle (though the current python interface is very numpy-oriented). If your intent is that people can edit this block with a text editor, yes, there are some binary words before the actual contents that may complicate that. On the other hand, are you asking for a way to write to and read this human readable content from the binary block. Along those lines, can you show how you would like this to be used in code (writing and reading)? |
Hi all,
So my main purpose to use QTable and asdf at the moment is to store the measured data, units and experiment meta-data together to be able to do improved data-handling. This works as expected in python. Now a non-python user finds the asdf file and would like to load it into any other GUI-based data-plotting program. But opening the file with a text-editor does not display the data block in a human readable way:
So he might be confused about how to read the data. If, on the other hand, the file would open as follows, it would be compatible with everything that can read text and still contain the schema, units and meta-data for advanced usage:
The use-case would be small measurements. Maybe a 'compressor' saving data in text instead of binary would be a solution (and some statement in the yaml-header about how to read / 'decompress' that block by asdf)? |
You can supply a keyword argument to the
Which will produce this form of the ASDF file:
Would this suffice for your needs? |
Hi @perrygreenfield, thank you for your suggestion. The ´all_array_storage='inline'´ keyword goes in the right direction. I did not find it in the astropy documentation (QTable.write.help("asdf") ), so thank you for pointing it out. For the purpose of comparability/ accessibility to the data I would still feel an array like structure outside of the yaml would be more suitable, as most data-programs can import row-like data. |
I think something we will be looking at soon is a way to support things other than arrays in binary blocks. But we are currently focussed on chunking support so it will have to wait after that (but may inform some changes we may need to make to support chunking with options for other kinds of content). Thanks for your feedback. |
Hi all,
I would like to save my astropy QTables with the asdf format to also save the meta dictionary and units. The only thing that holds me back is comparability with other users who might not want to use python to evaluate the data.
Would it be possible to store the data (relatively small) after the yaml header in a human-readable format like ecsv does? Or is there a hard reason why it needs to be a binary block?
PS: I found the ASDF-option to save inline arrays inside the yaml, but I think it is not accessible via QTable.write() and it seems not very human-readable nor easy to extract with GUI-software..
PS2: using ecsv with QTable.read() it does not import the meta dictionary as a dictionary and asdf seems more future-proof.
The text was updated successfully, but these errors were encountered: