Created
November 10, 2022 16:11
-
-
Save braingram/b369a6326e299088fb98bcef38a01c7d to your computer and use it in GitHub Desktop.
This file contains 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
import io | |
import asdf | |
b = io.BytesIO(b"""#ASDF 1.0.0 | |
#ASDF_STANDARD 1.5.0 | |
%YAML 1.1 | |
%TAG ! tag:stsci.edu:asdf/ | |
--- !core/asdf-1.1.0 | |
asdf_library: !core/software-1.0.0 {author: The ASDF Developers, homepage: 'http://github.com/asdf-format/asdf', | |
name: asdf, version: 2.8.1} | |
history: | |
extensions: | |
- !core/extension_metadata-1.0.0 | |
extension_class: asdf.extension.BuiltinExtension | |
software: !core/software-1.0.0 {name: asdf, version: 2.8.1} | |
- !core/extension_metadata-1.0.0 | |
extension_class: astropy.io.misc.asdf.extension.AstropyAsdfExtension | |
software: !core/software-1.0.0 {name: astropy, version: 4.3.1} | |
end_time: !time/time-1.1.0 2021-03-01T00:02:53.320 | |
...""") | |
af = asdf.open(b) | |
print(af['end_time']) | |
ob = io.BytesIO() | |
af.write_to(ob) | |
ob.seek(0) | |
print(ob.read().decode('ascii')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When run without asdf-astropy output is: