# Path: skyfield/units.py
# class Distance(Unit):
#     """A distance, stored internally as au and available in other units.
# 
#     You can initialize a ``Distance`` by providing a single float or a
#     float array as either an ``au=``, ``km=``, or ``m=`` parameter.
# 
#     You can access the magnitude of the distance with its three
#     attributes ``.au``, ``.km``, and ``.m``.  By default a distance
#     prints itself in astronomical units (au), but you can take control
#     of the formatting and choice of units yourself using standard Python
#     numeric formatting:
# 
#     >>> d = Distance(au=1)
#     >>> print(d)
#     1.0 au
#     >>> print('{:.2f} km'.format(d.km))
#     149597870.70 km
# 
#     """
#     _warned = False
# 
#     def __init__(self, au=None, km=None, m=None):
#         if au is not None:
#             self.au = _to_array(au)
#             """Astronomical units."""
#         elif km is not None:
#             self.km = km = _to_array(km)
#             self.au = km / AU_KM
#         elif m is not None:
#             self.m = m = _to_array(m)
#             self.au = m / AU_M
#         else:
#             raise ValueError('to construct a Distance provide au, km, or m')
# 
#     @classmethod
#     def from_au(cls, au):
#         self = cls.__new__(cls)
#         self.au = _to_array(au)
#         return self
# 
#     @reify
#     def au(self):  # Empty property to provide Sphinx docstring.
#         """Astronomical units (the Earth-Sun distance of 149,597,870,700 m)."""
# 
#     @reify
#     def km(self):
#         """Kilometers (1,000 meters)."""
#         return self.au * AU_KM
# 
#     @reify
#     def m(self):
#         """Meters."""
#         return self.au * AU_M
# 
#     def __str__(self):
#         n = self.au
#         return ('{0} au' if getattr(n, 'shape', 0) else '{0:.6} au').format(n)
# 
#     def __repr__(self):
#         return '<{0} {1}>'.format(type(self).__name__, self)
# 
#     def length(self):
#         """Compute the length when this is an |xyz| vector.
# 
#         The Euclidean vector length of this vector is returned as a new
#         :class:`~skyfield.units.Distance` object.
# 
#         >>> from skyfield.api import Distance
#         >>> d = Distance(au=[1, 1, 0])
#         >>> d.length()
#         <Distance 1.41421 au>
# 
#         """
#         return Distance(au=length_of(self.au))
# 
#     def light_seconds(self):
#         """Return the length of this vector in light seconds."""
#         return self.m / C
# 
#     def to(self, unit):
#         """Convert this distance to the given AstroPy unit."""
#         from astropy.units import au
#         return (self.au * au).to(unit)


from skyfield.units import Distance
"""Physical data for the planets from the JPL HORIZONS system.

To rebuild this data, consult the following IPython Notebook:

https://github.com/brandon-rhodes/astronomy-notebooks/blob/master/Utils-HORIZONS-data.ipynb

"""

radii_km = [
    ('Sun', 695500.0),
    ('Mercury', 2440.0),
    ('Venus', 6051.8),
    ('Earth', 6371.01),
    ('Mars', 3389.9),
    ('Jupiter', 69911.0),
    ('Saturn', 58232.0),
    ('Uranus', 25362.0),
    ('Neptune', 24624.0),
    ('134340 Pluto', 1195.0),
    ]

def festoon_ephemeris(ephemeris):
    for name, radius_km in radii_km:
        name = name.lower().split()[-1]

# Path: skyfield/units.py
# class Distance(Unit):
#     """A distance, stored internally as au and available in other units.
# 
#     You can initialize a ``Distance`` by providing a single float or a
#     float array as either an ``au=``, ``km=``, or ``m=`` parameter.
# 
#     You can access the magnitude of the distance with its three
#     attributes ``.au``, ``.km``, and ``.m``.  By default a distance
#     prints itself in astronomical units (au), but you can take control
#     of the formatting and choice of units yourself using standard Python
#     numeric formatting:
# 
#     >>> d = Distance(au=1)
#     >>> print(d)
#     1.0 au
#     >>> print('{:.2f} km'.format(d.km))
#     149597870.70 km
# 
#     """
#     _warned = False
# 
#     def __init__(self, au=None, km=None, m=None):
#         if au is not None:
#             self.au = _to_array(au)
#             """Astronomical units."""
#         elif km is not None:
#             self.km = km = _to_array(km)
#             self.au = km / AU_KM
#         elif m is not None:
#             self.m = m = _to_array(m)
#             self.au = m / AU_M
#         else:
#             raise ValueError('to construct a Distance provide au, km, or m')
# 
#     @classmethod
#     def from_au(cls, au):
#         self = cls.__new__(cls)
#         self.au = _to_array(au)
#         return self
# 
#     @reify
#     def au(self):  # Empty property to provide Sphinx docstring.
#         """Astronomical units (the Earth-Sun distance of 149,597,870,700 m)."""
# 
#     @reify
#     def km(self):
#         """Kilometers (1,000 meters)."""
#         return self.au * AU_KM
# 
#     @reify
#     def m(self):
#         """Meters."""
#         return self.au * AU_M
# 
#     def __str__(self):
#         n = self.au
#         return ('{0} au' if getattr(n, 'shape', 0) else '{0:.6} au').format(n)
# 
#     def __repr__(self):
#         return '<{0} {1}>'.format(type(self).__name__, self)
# 
#     def length(self):
#         """Compute the length when this is an |xyz| vector.
# 
#         The Euclidean vector length of this vector is returned as a new
#         :class:`~skyfield.units.Distance` object.
# 
#         >>> from skyfield.api import Distance
#         >>> d = Distance(au=[1, 1, 0])
#         >>> d.length()
#         <Distance 1.41421 au>
# 
#         """
#         return Distance(au=length_of(self.au))
# 
#     def light_seconds(self):
#         """Return the length of this vector in light seconds."""
#         return self.m / C
# 
#     def to(self, unit):
#         """Convert this distance to the given AstroPy unit."""
#         from astropy.units import au
#         return (self.au * au).to(unit)


# Path: skyfield/data/horizons.py
from skyfield.units import Distance

"""Physical data for the planets from the JPL HORIZONS system.

To rebuild this data, consult the following IPython Notebook:

https://github.com/brandon-rhodes/astronomy-notebooks/blob/master/Utils-HORIZONS-data.ipynb

"""

radii_km = [
    ('Sun', 695500.0),
    ('Mercury', 2440.0),
    ('Venus', 6051.8),
    ('Earth', 6371.01),
    ('Mars', 3389.9),
    ('Jupiter', 69911.0),
    ('Saturn', 58232.0),
    ('Uranus', 25362.0),
    ('Neptune', 24624.0),
    ('134340 Pluto', 1195.0),
    ]

def festoon_ephemeris(ephemeris):
    for name, radius_km in radii_km:
        name = name.lower().split()[-1]

        getattr(ephemeris, name).radius = Distance(km=radius_km)