Source code for asdf_astropy.converters.coordinates.earth_location
from asdf.extension import Converter
[docs]
class EarthLocationConverter(Converter):
tags = ("tag:astropy.org:astropy/coordinates/earthlocation-*",)
types = (
"astropy.coordinates.earth.EarthLocation",
"astropy.utils.masked.core.MaskedEarthLocation",
)
[docs]
def to_yaml_tree(self, obj, tag, ctx):
result = obj.info._represent_as_dict()
result.pop("__class__", None)
return result
[docs]
def from_yaml_tree(self, node, tag, ctx):
from astropy.coordinates.earth import EarthLocation
return EarthLocation.info._construct_from_dict(node)