# Path: skyfield/constants.py
# AU_M = 149597870700             # per IAU 2012 Resolution B2
# AU_KM = 149597870.700
# ASEC360 = 1296000.0
# DAY_S = 86400.0
# ASEC2RAD = 4.848136811095359935899141e-6
# DEG2RAD = 0.017453292519943296
# RAD2DEG = 57.295779513082321
# C = 299792458.0                            # m/s
# ANGVEL = 7.2921150e-5           # radians/s
# ERAD = 6378136.6                # meters
# IERS_2010_INVERSE_EARTH_FLATTENING = 298.25642
# GS = 1.32712440017987e+20
# T0 = 2451545.0
# B1950 = 2433282.4235
# C_AUDAY = C * DAY_S / AU_M
# 
# Path: skyfield/descriptorlib.py
# class reify(object):
#     """Adapted from Pyramid's `reify()` memoizing decorator."""
#     def __init__(self, method):
#         self.method = method
#         update_wrapper(self, method)
# 
#     def __get__(self, instance, objtype=None):
#         if instance is None:
#             return self
#         value = self.method(instance)
#         instance.__dict__[self.__name__] = value
#         return value
# 
# Path: skyfield/functions.py
# def _to_array(value):
#     """Convert plain Python sequences into NumPy arrays.
# 
#     This helps Skyfield endpoints convert caller-provided tuples and
#     lists into NumPy arrays.  If the ``value`` is not a sequence, then
#     it is coerced to a Numpy float object, but not an actual array.
# 
#     """
#     if hasattr(value, 'shape'):
#         return value
#     elif hasattr(value, '__len__'):
#         return array(value)
#     else:
#         return float64(value)
# 
# def length_of(xyz):
#     """Given a 3-element array |xyz|, return its length.
# 
#     The three elements can be simple scalars, or the array can be two
#     dimensions and offer three whole series of x, y, and z coordinates.
# 
#     """
#     return sqrt((xyz * xyz).sum(axis=0))


import numpy as np
from numpy import abs, copysign, isnan
from .constants import AU_KM, AU_M, C, DAY_S, tau
from .descriptorlib import reify
from .functions import _to_array, length_of
        from astropy.units import au
        from astropy.units import au, d
        from astropy.units import rad
        from astropy.coordinates import Angle
        from astropy.units import rad
        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."""

# Path: skyfield/constants.py
# AU_M = 149597870700             # per IAU 2012 Resolution B2
# AU_KM = 149597870.700
# ASEC360 = 1296000.0
# DAY_S = 86400.0
# ASEC2RAD = 4.848136811095359935899141e-6
# DEG2RAD = 0.017453292519943296
# RAD2DEG = 57.295779513082321
# C = 299792458.0                            # m/s
# ANGVEL = 7.2921150e-5           # radians/s
# ERAD = 6378136.6                # meters
# IERS_2010_INVERSE_EARTH_FLATTENING = 298.25642
# GS = 1.32712440017987e+20
# T0 = 2451545.0
# B1950 = 2433282.4235
# C_AUDAY = C * DAY_S / AU_M
# 
# Path: skyfield/descriptorlib.py
# class reify(object):
#     """Adapted from Pyramid's `reify()` memoizing decorator."""
#     def __init__(self, method):
#         self.method = method
#         update_wrapper(self, method)
# 
#     def __get__(self, instance, objtype=None):
#         if instance is None:
#             return self
#         value = self.method(instance)
#         instance.__dict__[self.__name__] = value
#         return value
# 
# Path: skyfield/functions.py
# def _to_array(value):
#     """Convert plain Python sequences into NumPy arrays.
# 
#     This helps Skyfield endpoints convert caller-provided tuples and
#     lists into NumPy arrays.  If the ``value`` is not a sequence, then
#     it is coerced to a Numpy float object, but not an actual array.
# 
#     """
#     if hasattr(value, 'shape'):
#         return value
#     elif hasattr(value, '__len__'):
#         return array(value)
#     else:
#         return float64(value)
# 
# def length_of(xyz):
#     """Given a 3-element array |xyz|, return its length.
# 
#     The three elements can be simple scalars, or the array can be two
#     dimensions and offer three whole series of x, y, and z coordinates.
# 
#     """
#     return sqrt((xyz * xyz).sum(axis=0))


# Path: skyfield/units.py
import numpy as np
from numpy import abs, copysign, isnan
from .constants import AU_KM, AU_M, C, DAY_S, tau
from .descriptorlib import reify
from .functions import _to_array, length_of
        from astropy.units import au
        from astropy.units import au, d
        from astropy.units import rad
        from astropy.coordinates import Angle
        from astropy.units import rad

        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