astropy / asdf-astropy

This is the extension library for ASDF to provide support for Astropy.
https://asdf-astropy.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
15 stars 14 forks source link

Missing converter for `astropy.coordinates.representation.geodetic` #182

Open braingram opened 1 year ago

braingram commented 1 year ago

There does not appear to be a converter for the following

WGS84GeodeticRepresentation
WGS72GeodeticRepresentation
GRS80GeodeticRepresentation

Now found in astropy.coordinates.representation.geodetic https://github.com/astropy/astropy/blob/9ec5277724150ea178282f5dfbd9ca8782f89021/astropy/coordinates/representation/geodetic.py#L103-L121

This causes the current test suite to fail as discussed in this PR: https://github.com/astropy/asdf-astropy/pull/181

braingram commented 1 year ago

Running the following with:

import asdf
import astropy.units as u
import astropy.coordinates.earth

r = astropy.coordinates.earth.WGS84GeodeticRepresentation(lat=0 * u.rad, lon=0 * u.rad, height=0 * u.m)
asdf.AsdfFile({'r': r}).write_to('foo.asdf')

fails with

yaml.representer.RepresenterError: ('cannot represent an object', <WGS84GeodeticRepresentation (lon, lat, height) in (rad, rad, m)
    (0., 0., 0.)>)