Created
January 9, 2022 18:24
-
-
Save wtbarnes/f431e337b925165c02f36666198968ac to your computer and use it in GitHub Desktop.
Glue config for exporting coordinates to ASDF files
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
""" | |
Glue environment customization | |
""" | |
from glue.config import data_exporter | |
from astropy.coordinates import SkyCoord | |
import sunpy.coordinates # This registers the needed coordinate frames | |
import asdf | |
@data_exporter('Coordinate ASDF Exporter') | |
def coordinate_asdf_exporter(filename, data, **kwargs): | |
with asdf.AsdfFile({'loop': SkyCoord(data['coord'])}) as afile: | |
afile.write_to(filename) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment