
[c           @` s   d  Z  d d l m Z m Z m Z m Z d d l Z d d l Z d d l m Z d d l	 m
 Z
 d d l Z d d l m Z m Z d d l m Z d d	 l m Z d d
 l m Z d d l m Z d d l m Z d d l m Z m Z d d l m Z d d l  m! Z! d d l" m# Z# d d l m$ Z$ d d l% m& Z& m' Z' m( Z( m) Z) m* Z* m+ Z+ d d l% m, Z, d d d d d d d g Z- d d d d d  d! d" f Z. i d  d f d d f 6d  f d d f 6d" f d d! f 6d  f d d f 6d d  f d d f 6d f d d  f 6d d  d d" f d d! f 6d d  d f d d" f 6d  f d d f 6d  d d" f d d! f 6d  d f d d" f 6d  d d" f d d! f 6d  d f d d" f 6d d" f d  d! f 6d f d  d" f 6Z/ d d  d f Z0 d d f Z1 d! f Z2 e3 d#   e0 e1 e2 f D  Z4 e4 j5   Z6 i e7 d  d f 6e7 d d  f 6e j8 d d  f 6e j8 d$ e j8 d  d f 6e j8 d d f 6e j8 d$ e j8 d d f 6e j9 d d f 6e j9 d$ e j9 d d f 6Z: i i i e j; d% 6d! d  f d& 6d' 6i e j< d% 6d! d  f d& 6d( 6i e j= d% 6d! f d& 6d) 6d* 6i i e j> d% 6d! d  f d& 6d+ 6i e j? d% 6d! d  f d& 6d, 6i e j@ d% 6d! f d& 6d- 6i e jA d% 6d! f d& 6d. 6d/ 6ZB d0 e f d1     YZC d2 eC f d3     YZD d4 e f d5     YZE d6 eE f d7     YZF d8 eG f d9     YZH eI d:  ZJ d; eK f d<     YZL d S(=   u   
The astropy.time package provides functionality for manipulating times and
dates. Specific emphasis is placed on supporting time scales (e.g. UTC, TAI,
UT1) and time representations (e.g. JD, MJD, ISO 8601) that are used in
astronomy.
i    (   t   absolute_importt   divisiont   print_functiont   unicode_literalsN(   t   datetime(   t   defaultdicti   (   t   unitst	   constants(   t   _erfa(   t   UnitConversionError(   t   lazyproperty(   t   ShapedLikeNDArray(   t   override__dir__(   t	   MixinInfot   data_info_factory(   t   broadcast_to(   t   six(   t   zipi   (   t   day_frac(   t   TIME_FORMATSt   TIME_DELTA_FORMATSt   TimeJDt
   TimeUniquet   TimeAstropyTimet   TimeDatetime(   t   TimeFromEpochu   Timeu	   TimeDeltau   TIME_SCALESu   TIME_DELTA_SCALESu   ScaleValueErroru   OperandTypeErroru   TimeInfou   taiu   tcbu   tcgu   tdbu   ttu   ut1u   utcc         c` s(   |  ] } | D] } | | f Vq q d  S(   N(    (   t   .0t   scalest   scale(    (    s0   lib/python2.7/site-packages/astropy/time/core.pys	   <genexpr>>   s   g      ?u   functionu   scalesu   IAU2006u   IAU2000u   IAU1982u   meanu   IAU2006Au   IAU2000Au   IAU2000Bu   IAU1994u   apparentt   TimeInfoc        
   B` s   e  Z d  Z e d g  Z e j d h BZ e Z d Z	 e
 d    Z e d  Z e
 d    Z e e d e j d g  e j D] Z e e e  ^ q}   Z d   Z d   Z RS(   u   
    Container for meta information like name, description, format.  This is
    required when the object is used as a mixin column within a table, but can
    be used as a general way to store meta information.
    u   unitu   serialize_methodu   formatu   scaleu	   precisionu	   in_subfmtu
   out_subfmtu   locationu   _delta_ut1_utcu   _delta_tdb_ttc         C` sQ   |  j  |  j } | d k r% d } n! | d k r: d } n t d   | |  j S(	   Nu   formatted_valueu   valueu   jd1_jd2u   jd1u   jd2u7   serialize method must be 'formatted_value' or 'jd1_jd2'(   u   value(   u   jd1u   jd2(   t   serialize_methodt   _serialize_contextt
   ValueErrort   _represent_as_dict_extra_attrs(   t   selft   methodt   out(    (    s0   lib/python2.7/site-packages/astropy/time/core.pyt   _represent_as_dict_attrsq   s    		c         C` sO   t  t |   j |  | rK i d d 6d d 6d d 6d d 6d d  6|  _ n  d  S(   Nu   jd1_jd2u   fitsu   formatted_valueu   ecsvu   hdf5u   yaml(   t   superR   t   __init__t   NoneR   (   R"   t   bound(    (    s0   lib/python2.7/site-packages/astropy/time/core.pyR'   }   s    
c         C` s   d  S(   N(   R(   (   R"   (    (    s0   lib/python2.7/site-packages/astropy/time/core.pyt   unit   s    t   namest   funcsc         C` s   d | k rZ d | k rZ | j  d  } d | d <| j  d  | d <| j  d  | d <n | d } | j  d  | d <|  j |   } | | _ | S(   Nu   jd1u   jd2u   formatu   jdu   valu   val2u   value(   t   popt   _parent_clst   format(   R"   t   mapR/   R$   (    (    s0   lib/python2.7/site-packages/astropy/time/core.pyt   _construct_from_dict_base   s    

	c         C` sg   | j  d d   } | j  d d   } |  j |  } | d  k	 rK | | _ n  | d  k	 rc | | _ n  | S(   Nu   _delta_ut1_utcu   _delta_tdb_tt(   R-   R(   R1   t   _delta_ut1_utct   _delta_tdb_tt(   R"   R0   t   delta_ut1_utct   delta_tdb_ttR$   (    (    s0   lib/python2.7/site-packages/astropy/time/core.pyt   _construct_from_dict   s    (   u   formatu   scaleu	   precisionu	   in_subfmtu
   out_subfmtu   locationu   _delta_ut1_utcu   _delta_tdb_tt(   t   __name__t
   __module__t   __doc__t   sett   attrs_from_parentR   t
   attr_namest   Truet   _supports_indexingR!   t   propertyR%   t   FalseR'   R*   t   staticmethodR   t   _statst   statt   getattrt   npt   info_summary_statsR1   R6   (    (    (    s0   lib/python2.7/site-packages/astropy/time/core.pyR   a   s     +	t   TimeDeltaInfoc           B` s   e  Z d Z d   Z RS(   u   formatu   scalec         C` s   |  j  |  S(   N(   R1   (   R"   R0   (    (    s0   lib/python2.7/site-packages/astropy/time/core.pyR6      s    (   u   formatu   scale(   R7   R8   R!   R6   (    (    (    s0   lib/python2.7/site-packages/astropy/time/core.pyRG      s   t   Timec        	   B` s  e  Z d  Z e Z e Z d Z dC Z	 dC dC dC dC dC dC dC e
 d  Z d   Z dC dC dC dC dC dC dC e
 d  Z dC dC dC d  Z d   Z e d    Z e   Z e d    Z e j d	    Z d
   Z d   Z e d    Z d   Z e d    Z e j d    Z e d    Z e j d    Z e d    Z e j d    Z e d    Z e j d    Z d   Z e d    Z  e d    Z! e d    Z" d dC dC d  Z# dC dC d  Z$ e% e$ j e& j'  re$ j j d e( e) d j*    d e( e) d j*     e$ _ n  d   Z+ dC d   Z, dC e
 d!  Z- d"   Z. d#   Z/ d$   Z0 dC e
 d%  Z1 dC dC d&  Z2 dC dC d'  Z3 d( d)  Z4 dC dC e
 d*  Z5 dC dC e
 d+  Z6 dC dC e
 d,  Z7 d( d-  Z8 e9 d.    Z: d/   Z; e< d0    Z= d1   Z> dC e
 d2  Z? dC dC d3  Z@ d4   ZA e e@ eA  ZB dC dC d5  ZC d6   ZD e eC eD  ZE d7   ZF d8   ZG d9   ZH d:   ZI dC d;  ZJ d<   ZK d=   ZL d>   ZM d?   ZN d@   ZO dA   ZP dC dB  ZQ eR jS j eQ _ RS(D   ub  
    Represent and manipulate times and dates for astronomy.

    A `Time` object is initialized with one or more times in the ``val``
    argument.  The input times in ``val`` must conform to the specified
    ``format`` and must correspond to the specified time ``scale``.  The
    optional ``val2`` time input should be supplied only for numeric input
    formats (e.g. JD) where very high precision (better than 64-bit precision)
    is required.

    The allowed values for ``format`` can be listed with::

      >>> list(Time.FORMATS)
      ['jd', 'mjd', 'decimalyear', 'unix', 'cxcsec', 'gps', 'plot_date',
       'datetime', 'iso', 'isot', 'yday', 'fits', 'byear', 'jyear', 'byear_str',
       'jyear_str']

    Parameters
    ----------
    val : sequence, str, number, or `~astropy.time.Time` object
        Value(s) to initialize the time or times.
    val2 : sequence, str, or number; optional
        Value(s) to initialize the time or times.
    format : str, optional
        Format of input value(s)
    scale : str, optional
        Time scale of input value(s), must be one of the following:
        ('tai', 'tcb', 'tcg', 'tdb', 'tt', 'ut1', 'utc')
    precision : int, optional
        Digits of precision in string representation of time
    in_subfmt : str, optional
        Subformat for inputting string times
    out_subfmt : str, optional
        Subformat for outputting string times
    location : `~astropy.coordinates.EarthLocation` or tuple, optional
        If given as an tuple, it should be able to initialize an
        an EarthLocation instance, i.e., either contain 3 items with units of
        length for geocentric coordinates, or contain a longitude, latitude,
        and an optional height for geodetic coordinates.
        Can be a single location, or one for each input time.
    copy : bool, optional
        Make a copy of the input values
    i N  c
         C` sF   t  | |   r* | j d | d |	  }
 n t t |   j |   }
 |
 S(   NR/   t   copy(   t
   isinstancet	   replicateR&   RH   t   __new__(   t   clst   valt   val2R/   R   t	   precisiont	   in_subfmtt
   out_subfmtt   locationRI   R"   (    (    s0   lib/python2.7/site-packages/astropy/time/core.pyRL      s    c         C` s
   |  j  f S(   N(   t   _time(   R"   (    (    s0   lib/python2.7/site-packages/astropy/time/core.pyt   __getnewargs__   s    c
      	   C` s  | d  k	 rI d d l m }
 t | |
  r7 | |  _ qR |
 |   |  _ n	 d  |  _ t | |  j  r | d  k	 r | |  j _ n  | d  k	 r | |  j _ n  | d  k	 r | |  j _	 n  | d  k	 r |  j
 |  q n" |  j | | | | |	 | | |  |  j d  k	 r|  j j d k r|  j j |  j k ry" t |  j |  j d t |  _ Wqt k
 rt d j |  j j |  j    qXn  d  S(   Ni   (   t   EarthLocationi   t   suboku   The location with shape {0} cannot be broadcast against time with shape {1}. Typically, either give a single location or one for each time.(   R(   t   coordinatesRV   RJ   RS   t	   __class__RT   RP   RQ   RR   t
   _set_scalet   _init_from_valst   sizet   shapeR   R=   t	   ExceptionR    R/   (   R"   RN   RO   R/   R   RP   RQ   RR   RS   RI   RV   (    (    s0   lib/python2.7/site-packages/astropy/time/core.pyR'     s2    	!	c	   	      C` s1  | d k r d } n  | d k r* d } n  | d k r? d } n  t | |  } | d k	 r t | |  } y t j | |  Wq t k
 r t d   q Xn  | d k	 r t | t j  o | j   |  j	 k s t
 d j | t |  j	     q n  |  j | | | | | | |  |  _ |  j j |  _ d S(   u   
        Set the internal _format, scale, and _time attrs from user
        inputs.  This handles coercion into the correct shapes and
        some basic input validation.
        i   u   *uN   Input val and val2 have inconsistent shape; they cannot be broadcast together.u,   Scale {0!r} is not in the allowed scales {1}N(   R(   t   _make_arrayRE   t	   broadcastR    RJ   R   t   string_typest   lowert   SCALESt   ScaleValueErrorR/   t   sortedt   _get_time_fmtRT   t   namet   _format(	   R"   RN   RO   R/   R   RI   RP   RQ   RR   (    (    s0   lib/python2.7/site-packages/astropy/time/core.pyR[   +  s,    				c         C` s  | d
 k r | j j d k r g  |  j j   D]' \ } }	 t |	 t  r. | |	 f ^ q. }
 d j g  |
 D] \ } }	 | ^ qh  } |
 j d t	 f  n t
 | t j  o | j   |  j k s | d
 k r t d   q$t d j | t |  j     n% | |  j | f g }
 d j |  } xs |
 D]V \ } } y | | | | | | |  SWq+t k
 rj  q+t t f k
 rq+Xq+Wt d	 j |    d
 S(   uM  
        Given the supplied val, val2, format and scale try to instantiate
        the corresponding TimeFormat class to convert the input values into
        the internal jd1 and jd2.

        If format is `None` and the input is a string-type or object array then
        guess available formats and stop when one matches.
        u   Su   Uu   Ou;   any of the formats where the format keyword is optional {0}u   astropy_timeu5   No time format was given, and the input is not uniqueu2   Format {0!r} is not one of the allowed formats {1}u   the format class {0}u   Input values did not match {0}N(   u   Su   Uu   O(   R(   t   dtypet   kindt   FORMATSt   itemst
   issubclassR   R/   t   appendR   RJ   R   Ra   Rb   R    Re   R	   t	   TypeError(   R"   RN   RO   R/   R   RP   RQ   RR   Rg   RM   t   formatst   err_msgt   FormatClass(    (    s0   lib/python2.7/site-packages/astropy/time/core.pyRf   Q  s.    !"	c         C` s%   t  j   } |  d | d d d d  S(   u(  
        Creates a new object corresponding to the instant in time this
        method is called.

        .. note::
            "Now" is determined using the `~datetime.datetime.utcnow`
            function, so its accuracy and precision is determined by that
            function.  Generally that means it is set by the accuracy of
            your system clock.

        Returns
        -------
        nowtime
            A new `Time` object (or a subclass of `Time` if this is called from
            such a subclass) at the current time.
        RN   R/   u   datetimeR   u   utc(   R   t   utcnow(   RM   t   dtnow(    (    s0   lib/python2.7/site-packages/astropy/time/core.pyt   now|  s    c         C` s   |  j  S(   u?  
        Get or set time format.

        The format defines the way times are represented when accessed via the
        ``.value`` attribute.  By default it is the same as the format used for
        initializing the `Time` instance, but it can be set to any other value
        that could be used for initialization.  These can be listed with::

          >>> list(Time.FORMATS)
          ['jd', 'mjd', 'decimalyear', 'unix', 'cxcsec', 'gps', 'plot_date',
           'datetime', 'iso', 'isot', 'yday', 'fits', 'byear', 'jyear', 'byear_str',
           'jyear_str']
        (   Rh   (   R"   (    (    s0   lib/python2.7/site-packages/astropy/time/core.pyR/     s    c         C` s   | |  j  k r0 t d j t |  j      n  |  j  | } t | d  r g  | j D] } | d ^ qV } |  j | k r d |  _ q n  | |  j j |  j j	 |  j j
 |  j d |  j d |  j d t |  _ | |  _ d S(	   u   Set time formatu   format must be one of {0}u   subfmtsi    u   *RQ   RR   t   from_jdN(   Rk   R    R/   t   listt   hasattrt   subfmtsRR   RT   t   jd1t   jd2t   _scaleRP   RQ   R=   Rh   (   R"   R/   t
   format_clst   subfmtt   subfmt_names(    (    s0   lib/python2.7/site-packages/astropy/time/core.pyR/     s    	 		c         C` s.   d j  |  j j |  j |  j  t |  |  j    S(   Nu0   <{0} object: scale='{1}' format='{2}' value={3}>(   R/   RY   R7   R   RD   (   R"   (    (    s0   lib/python2.7/site-packages/astropy/time/core.pyt   __repr__  s    c         C` s   t  t |  |  j   S(   N(   t   strRD   R/   (   R"   (    (    s0   lib/python2.7/site-packages/astropy/time/core.pyt   __str__  s    c         C` s
   |  j  j S(   u
   Time scale(   RT   R   (   R"   (    (    s0   lib/python2.7/site-packages/astropy/time/core.pyR     s    c      	   C` s  | |  j  k r d S| |  j k rF t d j | t |  j     n  |  j  | f } t t |   } t j | d  } | d  | | d } | | k r t t |   } n  |  j	 j
 |  j	 j } } x t | d  | d  D] \ } }	 | | g }
 xm | |	 f |	 | f f D]S } d j |   } y t |  |  } Wn t k
 rMqX|
 j | | |   PqWt t | |	  } | |
   \ } } q W|  j |  j | | | |  j |  j |  j d t |  _	 d S(   u   
        This is the key routine that actually does time scale conversions.
        This is not public and not connected to the read-only scale property.
        Nu,   Scale {0!r} is not in the allowed scales {1}i   iu   _get_delta_{0}_{1}Rv   (    (   R   Rc   R    R/   Re   t   tuplet
   MULTI_HOPSt   gett   reversedRT   Rz   R{   R   RD   t   AttributeErrorRn   t   erfaRk   RP   RQ   RR   R=   (   R"   R   t   xformt
   xform_sortt   multit   xformsRz   R{   t   sys1t   sys2t   argst   sys12t	   dt_methodt   get_dtt	   conv_func(    (    s0   lib/python2.7/site-packages/astropy/time/core.pyRZ     s6    	$c         C` s
   |  j  j S(   u|   
        Decimal precision when outputting seconds as floating point (int
        value between 0 and 9 inclusive).
        (   RT   RP   (   R"   (    (    s0   lib/python2.7/site-packages/astropy/time/core.pyRP     s    c         C` sM   t  | t  s( | d k  s( | d k r7 t d   n  | |  j _ |  ` d  S(   Ni    i	   u2   precision attribute must be an int between 0 and 9(   RJ   t   intR    RT   RP   t   cache(   R"   RN   (    (    s0   lib/python2.7/site-packages/astropy/time/core.pyRP     s    (c         C` s
   |  j  j S(   ud   
        Unix wildcard pattern to select subformats for parsing string input
        times.
        (   RT   RQ   (   R"   (    (    s0   lib/python2.7/site-packages/astropy/time/core.pyRQ   	  s    c         C` s7   t  | t j  s! t d   n  | |  j _ |  ` d  S(   Nu$   in_subfmt attribute must be a string(   RJ   R   Ra   R    RT   RQ   R   (   R"   RN   (    (    s0   lib/python2.7/site-packages/astropy/time/core.pyRQ     s    c         C` s
   |  j  j S(   uR   
        Unix wildcard pattern to select subformats for outputting times.
        (   RT   RR   (   R"   (    (    s0   lib/python2.7/site-packages/astropy/time/core.pyRR     s    c         C` s7   t  | t j  s! t d   n  | |  j _ |  ` d  S(   Nu%   out_subfmt attribute must be a string(   RJ   R   Ra   R    RT   RR   R   (   R"   RN   (    (    s0   lib/python2.7/site-packages/astropy/time/core.pyRR     s    c         C` s   |  j  j j S(   u  The shape of the time instances.

        Like `~numpy.ndarray.shape`, can be set to a new shape by assigning a
        tuple.  Note that if different instances share some but not all
        underlying data, setting the shape of one instance can make the other
        instance unusable.  Hence, it is strongly recommended to get new,
        reshaped instances with the ``reshape`` method.

        Raises
        ------
        AttributeError
            If the shape of the ``jd1``, ``jd2``, ``location``,
            ``delta_ut1_utc``, or ``delta_tdb_tt`` attributes cannot be changed
            without the arrays being copied.  For these cases, use the
            `Time.reshape` method (which copies any arrays that cannot be
            reshaped in-place).
        (   RT   Rz   R]   (   R"   (    (    s0   lib/python2.7/site-packages/astropy/time/core.pyR]   &  s    c         C` s   g  } |  j  } x d D] } t |  | d   } | d  k	 r | j d k r y | | _  Wn. t k
 r x | D] } | | _  qm W  q X| j |  q q Wd  S(   Nu   jd1u   jd2u   _delta_ut1_utcu   _delta_tdb_ttu   locationi   (   u   jd1u   jd2u   _delta_ut1_utcu   _delta_tdb_ttu   location(   R]   RD   R(   R\   R   Rn   (   R"   R]   t   reshapedt   oldshapet   attrRN   RO   (    (    s0   lib/python2.7/site-packages/astropy/time/core.pyR]   ;  s    	
c         C` s   |  j  j j r | S| j   S(   N(   RT   Rz   R]   t   item(   R"   t   value(    (    s0   lib/python2.7/site-packages/astropy/time/core.pyt   _shaped_like_inputO  s    c         C` s   |  j  |  j j  S(   uU   
        First of the two doubles that internally store time value(s) in JD.
        (   R   RT   Rz   (   R"   (    (    s0   lib/python2.7/site-packages/astropy/time/core.pyRz   R  s    c         C` s   |  j  |  j j  S(   uV   
        Second of the two doubles that internally store time value(s) in JD.
        (   R   RT   R{   (   R"   (    (    s0   lib/python2.7/site-packages/astropy/time/core.pyR{   Y  s    c         C` s   t  |  |  j  S(   u   Time value(s) in current format(   RD   R/   (   R"   (    (    s0   lib/python2.7/site-packages/astropy/time/core.pyR   `  s    u   barycentricc         C` s  | j    d k r! t d   n  | d
 k rW |  j d
 k rK t d   n  |  j } n  d d l m } m } m } m } m	 }	 m
 }
 | j |    s t d   n  y | j d |   } Wn t k
 r t d	   n X|
 j |  h | j    d k r| j | d |    j j } n0 | j |	 d |    } | j |    j j } Wd
 QX| j j |  j |  j } t j | d | j  } t j | d | j  } | | j d d  t j } t | d d S(   u  Light travel time correction to the barycentre or heliocentre.

        The frame transformations used to calculate the location of the solar
        system barycentre and the heliocentre rely on the erfa routine epv00,
        which is consistent with the JPL DE405 ephemeris to an accuracy of
        11.2 km, corresponding to a light travel time of 4 microseconds.

        The routine assumes the source(s) are at large distance, i.e., neglects
        finite-distance effects.

        Parameters
        ----------
        skycoord : `~astropy.coordinates.SkyCoord`
            The sky location to calculate the correction for.
        kind : str, optional
            ``'barycentric'`` (default) or ``'heliocentric'``
        location : `~astropy.coordinates.EarthLocation`, optional
            The location of the observatory to calculate the correction for.
            If no location is given, the ``location`` attribute of the Time
            object is used
        ephemeris : str, optional
            Solar system ephemeris to use (e.g., 'builtin', 'jpl'). By default,
            use the one set with ``astropy.coordinates.solar_system_ephemeris.set``.
            For more information, see `~astropy.coordinates.solar_system_ephemeris`.

        Returns
        -------
        time_offset : `~astropy.time.TimeDelta`
            The time offset between the barycentre or Heliocentre and Earth,
            in TDB seconds.  Should be added to the original time to get the
            time in the Solar system barycentre or the Heliocentre.
            Also, the time conversion to BJD will then include the relativistic correction as well.
        u   barycentricu   heliocentricu?   'kind' parameter must be one of 'heliocentric' or 'barycentric'u\   An EarthLocation needs to be set or passed in to calculate bary- or heliocentric correctionsi   (   t   UnitSphericalRepresentationt   CartesianRepresentationt   HCRSt   ICRSt   GCRSt   solar_system_ephemerisu/   Given skycoord is not transformable to the ICRSt   obstimeu9   Supplied location does not have a valid `get_itrs` methodNi    t   axisiR   u   tdb(   u   barycentricu   heliocentric(   Rb   R    R(   RS   RX   R   R   R   R   R   R   t   is_transformable_tot   get_itrsR^   R:   t   transform_tot	   cartesiant   xyzt   icrst   represent_asRE   t   rollaxist   ndimt   sumt   constt   ct	   TimeDelta(   R"   t   skycoordRj   RS   t	   ephemerisR   R   R   R   R   R   t   itrst   cpost   gcrs_coot   spost   tcor_val(    (    s0   lib/python2.7/site-packages/astropy/time/core.pyt   light_travel_timei  s0    #.!c         C` sy  d d l  m } | j   t j   k rU t d j d j t t j        n  t | j   } | d k r t | j    d } n< | j
   | k r t d j | | t | j       n  | d k r |  j d k r t d   n  |  j j } nM | d k r-| d	 t j d
 d t j } n | | t j d
 d t j } |  j | | j
    } | | | t j  S(   u  Calculate sidereal time.

        Parameters
        ---------------
        kind : str
            ``'mean'`` or ``'apparent'``, i.e., accounting for precession
            only, or also for nutation.
        longitude : `~astropy.units.Quantity`, `str`, or `None`; optional
            The longitude on the Earth at which to compute the sidereal time.
            Can be given as a `~astropy.units.Quantity` with angular units
            (or an `~astropy.coordinates.Angle` or
            `~astropy.coordinates.Longitude`), or as a name of an
            observatory (currently, only ``'greenwich'`` is supported,
            equivalent to 0 deg).  If `None` (default), the ``lon`` attribute of
            the Time object is used.
        model : str or `None`; optional
            Precession (and nutation) model to use.  The available ones are:
            - {0}: {1}
            - {2}: {3}
            If `None` (default), the last (most recent) one from the appropriate
            list above is used.

        Returns
        -------
        sidereal time : `~astropy.coordinates.Longitude`
            Sidereal time as a quantity with units of hourangle
        i   (   t	   Longitudeu'   The kind of sidereal time has to be {0}u    or iuI   Model {0} not implemented for {1} sidereal time; available models are {2}uF   No longitude is given but the location for the Time object is not set.u	   greenwichg        t
   wrap_angleg     f@N(   RX   R   Rb   t   SIDEREAL_TIME_MODELSt   keysR    R/   t   joinRe   R(   t   upperRS   t   lont   ut   degreet   _erfa_sidereal_timet	   hourangle(   R"   Rj   t	   longitudet   modelR   t   available_modelst   gst(    (    s0   lib/python2.7/site-packages/astropy/time/core.pyt   sidereal_time  s,    	$!u   apparentu   meanc         C` s   d d l  m } | d } g  | d D]. } d D]! } t t |  |  j |  ^ q/ q% } | |   } | | t j  j t j  S(   u@   Calculate a sidereal time using a IAU precession/nutation model.i   (   R   u   functionu   scalesu   jd1u   jd2(   u   jd1u   jd2(   RX   R   RD   RT   R   t   radiant   toR   (   R"   R   R   t   erfa_functionR   t   jd_partt   erfa_parametersR   (    (    s0   lib/python2.7/site-packages/astropy/time/core.pyR     s    
.c         C` s   |  j  d d | S(   u  
        Return a fully independent copy the Time object, optionally changing
        the format.

        If ``format`` is supplied then the time format of the returned Time
        object will be set accordingly, otherwise it will be unchanged from the
        original.

        In this method a full copy of the internal time arrays will be made.
        The internal time arrays are normally not changeable by the user so in
        most cases the ``replicate()`` method should be used.

        Parameters
        ----------
        format : str, optional
            Time format of the copy.

        Returns
        -------
        tm : Time object
            Copy of this object
        u   copyR/   (   t   _apply(   R"   R/   (    (    s0   lib/python2.7/site-packages/astropy/time/core.pyRI     s    c         C` s   |  j  | r d n d d | S(   u	  
        Return a replica of the Time object, optionally changing the format.

        If ``format`` is supplied then the time format of the returned Time
        object will be set accordingly, otherwise it will be unchanged from the
        original.

        If ``copy`` is set to `True` then a full copy of the internal time arrays
        will be made.  By default the replica will use a reference to the
        original arrays when possible to save memory.  The internal time arrays
        are normally not changeable by the user so in most cases it should not
        be necessary to set ``copy`` to `True`.

        The convenience method copy() is available in which ``copy`` is `True`
        by default.

        Parameters
        ----------
        format : str, optional
            Time format of the replica.
        copy : bool, optional
            Return a true copy instead of using references where possible.

        Returns
        -------
        tm : Time object
            Replica of this object
        u   copyu	   replicateR/   (   R   (   R"   R/   RI   (    (    s0   lib/python2.7/site-packages/astropy/time/core.pyRK   %  s    c      	   ` sL   j  d d  } | d k r* |  j } n  t   rN     f d   } n*  d k rc d } n t j      } |  j j |  j j } } | r | |  } | |  } n  t	 t
 |  j  j |  j  } t | | |  j |  j |  j |  j d t | _ x d D] }	 y t |  |	  }
 Wn t k
 r6qn X| rt |
 d d  d k rd| |
  }
 q d k s| d k rt j |
  }
 qn  t | |	 |
  qWd |  j k r|  j | _ n  | | j k rt d j t | j     n  | j | } | | j j | j j | j j | j | j | j d t | _ | | _ | S(   u-  Create a new time object, possibly applying a method to the arrays.

        Parameters
        ----------
        method : str or callable
            If string, can be 'replicate'  or the name of a relevant
            `~numpy.ndarray` method. In the former case, a new time instance
            with unchanged internal data is created, while in the latter the
            method is applied to the internal ``jd1`` and ``jd2`` arrays, as
            well as to possible ``location``, ``_delta_ut1_utc``, and
            ``_delta_tdb_tt`` arrays.
            If a callable, it is directly applied to the above arrays.
            Examples: 'copy', '__getitem__', 'reshape', `~numpy.broadcast_to`.
        args : tuple
            Any positional arguments for ``method``.
        kwargs : dict
            Any keyword arguments for ``method``.  If the ``format`` keyword
            argument is present, this will be used as the Time format of the
            replica.

        Examples
        --------
        Some ways this is used internally::

            copy : ``_apply('copy')``
            replicate : ``_apply('replicate')``
            reshape : ``_apply('reshape', new_shape)``
            index or slice : ``_apply('__getitem__', item)``
            broadcast : ``_apply(np.broadcast, shape=new_shape)``
        u   formatc         ` s    |      S(   N(    (   t   array(   R   t   kwargsR#   (    s0   lib/python2.7/site-packages/astropy/time/core.pyt   <lambda>h  s    u	   replicateRv   u   _delta_ut1_utcu   _delta_tdb_ttu   locationu	   precisionu	   in_subfmtu
   out_subfmtu   sizei   u   copyu   flattenu   infou   format must be one of {0}N(   u   _delta_ut1_utcu   _delta_tdb_ttu   locationu	   precisionu	   in_subfmtu
   out_subfmt(   R-   R(   R/   t   callablet   operatort   methodcallerRT   Rz   R{   R&   RH   RY   RL   R   R   RP   RQ   RR   R=   RD   R   RI   t   setattrt   __dict__t   infoRk   R    Rw   R|   Rh   (   R"   R#   R   R   t
   new_formatt   apply_methodRz   R{   t   tmR   RN   t	   NewFormat(    (   R   R   R#   s0   lib/python2.7/site-packages/astropy/time/core.pyR   D  sN    	
		c         C` s
   |  j    S(   u   
        Overrides the default behavior of the `copy.copy` function in
        the python stdlib to behave like `Time.copy`. Does *not* make a
        copy of the JD arrays - only copies by reference.
        (   RK   (   R"   (    (    s0   lib/python2.7/site-packages/astropy/time/core.pyt   __copy__  s    c         C` s
   |  j    S(   u   
        Overrides the default behavior of the `copy.deepcopy` function
        in the python stdlib to behave like `Time.copy`. Does make a
        copy of the JD arrays.
        (   RI   (   R"   t   memo(    (    s0   lib/python2.7/site-packages/astropy/time/core.pyt   __deepcopy__  s    c         C` s  | d k r t j | |  j  S|  j } | d k  rA | | } n  | rn | j |  j k  rn t j | |  } n  g  t |  j  D] \ } } | | k r | nd t j |  j d | s | | k  r | n | d | f d | | | s | | k r d n d  ^ q~ S(   u  Turn argmin, argmax output into an advanced index.

        Argmin, argmax output contains indices along a given axis in an array
        shaped like the other dimensions.  To use this to get values at the
        correct location, a list is constructed in which the other axes are
        indexed sequentially.  For ``keepdims`` is ``True``, the net result is
        the same as constructing an index grid with ``np.ogrid`` and then
        replacing the ``axis`` item with ``indices`` with its shaped expanded
        at ``axis``. For ``keepdims`` is ``False``, the result is the same but
        with the ``axis`` dimension removed from all list entries.

        For ``axis`` is ``None``, this calls :func:`~numpy.unravel_index`.

        Parameters
        ----------
        indices : array
            Output of argmin or argmax.
        axis : int or None
            axis along which argmin or argmax was used.
        keepdims : bool
            Whether to construct indices that keep or remove the axis along
            which argmin or argmax was used.  Default: ``False``.

        Returns
        -------
        advanced_index : list of arrays
            Suitable for use as an advanced index.
        i    i   i   N(   i   (   i   (	   R(   RE   t   unravel_indexR]   R   t   expand_dimst	   enumeratet   aranget   reshape(   R"   t   indicesR   t   keepdimsR   t   it   s(    (    s0   lib/python2.7/site-packages/astropy/time/core.pyt   _advanced_index  s    	c         C` sI   |  j  |  j } | j | d t } |  j  | |  j } | j | |  S(   u)  Return indices of the minimum values along the given axis.

        This is similar to :meth:`~numpy.ndarray.argmin`, but adapted to ensure
        that the full precision given by the two doubles ``jd1`` and ``jd2``
        is used.  See :func:`~numpy.argmin` for detailed documentation.
        R   (   Rz   R{   t   minR=   t   argmin(   R"   R   R$   t   jdt   approxt   dt(    (    s0   lib/python2.7/site-packages/astropy/time/core.pyR     s    
c         C` sI   |  j  |  j } | j | d t } |  j  | |  j } | j | |  S(   u)  Return indices of the maximum values along the given axis.

        This is similar to :meth:`~numpy.ndarray.argmax`, but adapted to ensure
        that the full precision given by the two doubles ``jd1`` and ``jd2``
        is used.  See :func:`~numpy.argmax` for detailed documentation.
        R   (   Rz   R{   t   maxR=   t   argmax(   R"   R   R$   R   R   R   (    (    s0   lib/python2.7/site-packages/astropy/time/core.pyR     s    ic         C` sp   |  j  } |  |  j | d d j  } | d k rP t j | j   | j   f  St j d | | f d |  Sd S(   uw  Returns the indices that would sort the time array.

        This is similar to :meth:`~numpy.ndarray.argsort`, but adapted to ensure
        that the full precision given by the two doubles ``jd1`` and ``jd2``
        is used, and that corresponding attributes are copied.  Internally,
        it uses :func:`~numpy.lexsort`, and hence no sort method can be chosen.
        R/   u   jdR   R   N(   R   RY   R(   RE   t   lexsortt   ravel(   R"   R   t	   jd_approxt   jd_remainder(    (    s0   lib/python2.7/site-packages/astropy/time/core.pyt   argsort  s
    	c         C` s;   | d k	 r t d   n  |  |  j |  j |  | |  S(   u  Minimum along a given axis.

        This is similar to :meth:`~numpy.ndarray.min`, but adapted to ensure
        that the full precision given by the two doubles ``jd1`` and ``jd2``
        is used, and that corresponding attributes are copied.

        Note that the ``out`` argument is present only for compatibility with
        ``np.min``; since `Time` instances are immutable, it is not possible
        to have an actual ``out`` to store the result in.
        uU   Since `Time` instances are immutable, ``out`` cannot be set to anything but ``None``.N(   R(   R    R   R   (   R"   R   R$   R   (    (    s0   lib/python2.7/site-packages/astropy/time/core.pyR     s    c         C` s;   | d k	 r t d   n  |  |  j |  j |  | |  S(   u  Maximum along a given axis.

        This is similar to :meth:`~numpy.ndarray.max`, but adapted to ensure
        that the full precision given by the two doubles ``jd1`` and ``jd2``
        is used, and that corresponding attributes are copied.

        Note that the ``out`` argument is present only for compatibility with
        ``np.max``; since `Time` instances are immutable, it is not possible
        to have an actual ``out`` to store the result in.
        uU   Since `Time` instances are immutable, ``out`` cannot be set to anything but ``None``.N(   R(   R    R   R   (   R"   R   R$   R   (    (    s0   lib/python2.7/site-packages/astropy/time/core.pyR   !  s    c         C` sA   | d k	 r t d   n  |  j | d | |  j | d | S(   u  Peak to peak (maximum - minimum) along a given axis.

        This is similar to :meth:`~numpy.ndarray.ptp`, but adapted to ensure
        that the full precision given by the two doubles ``jd1`` and ``jd2``
        is used.

        Note that the ``out`` argument is present only for compatibility with
        `~numpy.ptp`; since `Time` instances are immutable, it is not possible
        to have an actual ``out`` to store the result in.
        uU   Since `Time` instances are immutable, ``out`` cannot be set to anything but ``None``.R   N(   R(   R    R   R   (   R"   R   R$   R   (    (    s0   lib/python2.7/site-packages/astropy/time/core.pyt   ptp1  s    c         C` s#   |  |  j  |  j |  | d t S(   u"  Return a copy sorted along the specified axis.

        This is similar to :meth:`~numpy.ndarray.sort`, but internally uses
        indexing with :func:`~numpy.lexsort` to ensure that the full precision
        given by the two doubles ``jd1`` and ``jd2`` is kept, and that
        corresponding attributes are properly sorted and copied as well.

        Parameters
        ----------
        axis : int or None
            Axis to be sorted.  If ``None``, the flattened array is sorted.
            By default, sort over the last axis.
        R   (   R   R   R=   (   R"   R   (    (    s0   lib/python2.7/site-packages/astropy/time/core.pyt   sortB  s    c         C` s
   t  t  S(   uA   
        Return the cache associated with this instance.
        (   R   t   dict(   R"   (    (    s0   lib/python2.7/site-packages/astropy/time/core.pyR   S  s    c         C` sd  | |  j  k r} |  j d k	 r} |  j d } | | k ru | |  j k rO |  } n |  j   } | j |  | | | <n  | | S| |  j k r|  j d } | | k r | |  j k r |  } n |  j d |  } | j | j	 j
 d |   } | | | <n  | | S| t k rS|  j d k r,t d   q`t d j |  j j |  j |    n |  j |  Sd S(   uU   
        Get dynamic attributes to output format or do timescale conversion.
        u   scaleu   formatR/   t   parentuC   Cannot convert TimeDelta with undefined scale to any defined scale.u2   Cannot convert {0} with scale '{1}' to scale '{2}'N(   Rc   R   R(   R   RK   RZ   Rk   R/   R   RT   t   to_valuet   TIME_SCALESRd   RY   R7   t   __getattribute__(   R"   R   R   R   R   (    (    s0   lib/python2.7/site-packages/astropy/time/core.pyt   __getattr__Z  s2    				c         C` s#   t  |  j  } | j |  j  | S(   N(   R:   Rc   t   updateRk   (   R"   t   result(    (    s0   lib/python2.7/site-packages/astropy/time/core.pyt   __dir__  s    c         C` sv   t  | d t } | j d k rr | j |  j k rr y t | |  j d t } Wqr t k
 rn t d   qr Xn  | S(   u   
        Ensure that `val` is matched to length of self.  If val has length 1
        then broadcast, otherwise cast to double and make sure shape matches.
        RI   i   RW   u   Attribute shape must match or be broadcastable to that of Time object. Typically, give either a single value or one for each time.(   R_   R=   R\   R]   R   R^   R    (   R"   RN   (    (    s0   lib/python2.7/site-packages/astropy/time/core.pyt   _match_shape  s    !c         C` sA   | d k r+ d d l m } | j   } n  | j |  j d | S(   u+  Find UT1 - UTC differences by interpolating in IERS Table.

        Parameters
        ----------
        iers_table : ``astropy.utils.iers.IERS`` table, optional
            Table containing UT1-UTC differences from IERS Bulletins A
            and/or B.  If `None`, use default version (see
            ``astropy.utils.iers``)
        return_status : bool
            Whether to return status values.  If `False` (default), iers
            raises `IndexError` if any time is out of the range
            covered by the IERS table.

        Returns
        -------
        ut1_utc : float or float array
            UT1-UTC, interpolated in IERS Table
        status : int or int array
            Status values (if ``return_status=`True```)::
            ``astropy.utils.iers.FROM_IERS_B``
            ``astropy.utils.iers.FROM_IERS_A``
            ``astropy.utils.iers.FROM_IERS_A_PREDICTION``
            ``astropy.utils.iers.TIME_BEFORE_IERS_RANGE``
            ``astropy.utils.iers.TIME_BEYOND_IERS_RANGE``

        Notes
        -----
        In normal usage, UT1-UTC differences are calculated automatically
        on the first instance ut1 is needed.

        Examples
        --------
        To check in code whether any times are before the IERS table range::

            >>> from astropy.utils.iers import TIME_BEFORE_IERS_RANGE
            >>> t = Time(['1961-01-01', '2000-01-01'], scale='utc')
            >>> delta, status = t.get_delta_ut1_utc(return_status=True)
            >>> status == TIME_BEFORE_IERS_RANGE
            array([ True, False]...)
        i   (   t   IERSt   return_statusN(   R(   t
   utils.iersR  t   opent   ut1_utct   utc(   R"   t
   iers_tableR  R  (    (    s0   lib/python2.7/site-packages/astropy/time/core.pyt   get_delta_ut1_utc  s    )c   
      C` s   t  |  d  s d d l m } | j   } | d k r\ |  j } | j | j } } d } n	 |  j } | j	 | |  } | d k r t
 j | | |  \ } }	 | j	 | |	  } n  |  j |  n  |  j S(   u  
        Get ERFA DUT arg = UT1 - UTC.  This getter takes optional jd1 and
        jd2 args because it gets called that way when converting time scales.
        If delta_ut1_utc is not yet set, this will interpolate them from the
        the IERS table.
        u   _delta_ut1_utci   (   t	   IERS_Autou   utcu   ut1N(   Rx   R  R	  R  R(   R  Rz   R{   R   R  R   t   ut1utct   _set_delta_ut1_utcR2   (
   R"   Rz   R{   R	  R  t   self_utcR   t   deltat   jd1_utct   jd2_utc(    (    s0   lib/python2.7/site-packages/astropy/time/core.pyt   _get_delta_ut1_utc  s    				c         C` sI   t  | d  r' | j t j  j } n  |  j |  } | |  _ |  ` d  S(   Nu   to(   Rx   R   R   t   secondR   R   R2   R   (   R"   RN   (    (    s0   lib/python2.7/site-packages/astropy/time/core.pyR    s
    	c         C` s`  t  |  d  sY| d  k s' | d  k r` |  j d
 k rE t d   q` |  j j } |  j j } n  t j | |  \ } } t j	 | |  \ } } t
 | d |  d } |  j d  k r d d l m } | j d	 d	 d	  } n	 |  j } | j } t j | j | j  }	 | j }
 t j | | | | j t j  |	 j t j  |
 j t j   |  _ n  |  j S(   Nu   _delta_tdb_ttu   ttu   tdbuO   Accessing the delta_tdb_tt attribute is only possible for TT or TDB time scalesg      ?i   i   (   RV   g        (   u   ttu   tdb(   Rx   R(   R   R    RT   Rz   R{   R   t   tttait   taiutcR   RS   RX   RV   t   from_geodeticR   RE   t   hypott   xt   yt   zt   dtdbR   R   R   t   kmR3   (   R"   Rz   R{   t   njd1t   njd2t   utRV   RS   R   t   rxyR  (    (    s0   lib/python2.7/site-packages/astropy/time/core.pyt   _get_delta_tdb_tt  s(    			*c         C` sI   t  | d  r' | j t j  j } n  |  j |  } | |  _ |  ` d  S(   Nu   to(   Rx   R   R   R  R   R   R3   R   (   R"   RN   (    (    s0   lib/python2.7/site-packages/astropy/time/core.pyt   _set_delta_tdb_tt   s
    	c         C` s  t  | t  sH y t |  } WqH t k
 rD t |  | d   qH Xn  t  | t  } | r|  j   } |  j | j k r | j | j d  f k r t	 | | j  } q n% | j
 | j d  k	 r | j n d  x d D]% } t | |  r t | |  q q Wno |  j t k r|  j n	 |  j j } t | j | j d d d | j } | j | j k rrt	 | | j  } n  | j j | j j } | j j | j j } t | |  \ | j _ | j _ | r| j
 |  j  n  | S(	   Nu   -u   taiu   _delta_ut1_utcu   _delta_tdb_ttR/   u   jdR   (   u   _delta_ut1_utcu   _delta_tdb_tt(   RJ   RH   R   R^   t   OperandTypeErrorRK   R   Rc   R(   RD   RZ   Rx   t   delattrt   TIME_DELTA_SCALESRT   t   taiRz   R{   R   (   R"   t   othert   other_is_deltaR$   R   t	   self_timeRz   R{   (    (    s0   lib/python2.7/site-packages/astropy/time/core.pyt   __sub__,  s8    !c         C` sp  t  | t  sH y t |  } WqH t k
 rD t |  | d   qH Xn  t  | t  sl t |  | d   n  |  j   } |  j | j k r | j | j d  f k r t	 | | j  } q n% | j
 | j d  k	 r | j n d  x- d D]% } t | |  r t | |  q q W| j j | j j } | j j | j j } t | |  \ | j _ | j _ | j
 |  j  | S(   Nu   +u   taiu   _delta_ut1_utcu   _delta_tdb_tt(   u   _delta_ut1_utcu   _delta_tdb_tt(   RJ   RH   R   R^   R!  RK   R   Rc   R(   RD   RZ   Rx   R"  RT   Rz   R{   R   (   R"   R%  R$   R   Rz   R{   (    (    s0   lib/python2.7/site-packages/astropy/time/core.pyt   __add__\  s(    %!c         C` s   |  j  |  S(   N(   R)  (   R"   R%  (    (    s0   lib/python2.7/site-packages/astropy/time/core.pyt   __radd__  s    c         C` s   |  j  |  } | S(   N(   R(  (   R"   R%  R$   (    (    s0   lib/python2.7/site-packages/astropy/time/core.pyt   __rsub__  s    c         C` s	  | j  |  j  k	 rW y |  j  | d |  j } WqW t k
 rS t |  | |   qW Xn  |  j d k	 rx |  j | j k s | j d k	 r | j |  j k r t d j |  j | j    n  |  j d k	 r | j d k	 r t | |  j  } n  |  j	 | j	 |  j
 | j
 S(   uw   If other is of same class as self, return difference in self.scale.
        Otherwise, raise OperandTypeError.
        R   u>   Cannot compare TimeDelta instances with scales '{0}' and '{1}'N(   RY   R   R^   R!  R(   Rc   Ro   R/   RD   Rz   R{   (   R"   R%  t   op(    (    s0   lib/python2.7/site-packages/astropy/time/core.pyt   _time_difference  s    !!	c         C` s   |  j  | d  d k  S(   Nu   <g        (   R-  (   R"   R%  (    (    s0   lib/python2.7/site-packages/astropy/time/core.pyt   __lt__  s    c         C` s   |  j  | d  d k S(   Nu   <=g        (   R-  (   R"   R%  (    (    s0   lib/python2.7/site-packages/astropy/time/core.pyt   __le__  s    c         C` s2   y |  j  |  } Wn t k
 r' t SX| d k S(   u   
        If other is an incompatible object for comparison, return `False`.
        Otherwise, return `True` if the time difference between self and
        other is zero.
        g        (   R-  R!  R@   (   R"   R%  t   diff(    (    s0   lib/python2.7/site-packages/astropy/time/core.pyt   __eq__  s
    c         C` s2   y |  j  |  } Wn t k
 r' t SX| d k S(   u   
        If other is an incompatible object for comparison, return `True`.
        Otherwise, return `False` if the time difference between self and
        other is zero.
        g        (   R-  R!  R=   (   R"   R%  R0  (    (    s0   lib/python2.7/site-packages/astropy/time/core.pyt   __ne__  s
    c         C` s   |  j  | d  d k S(   Nu   >g        (   R-  (   R"   R%  (    (    s0   lib/python2.7/site-packages/astropy/time/core.pyt   __gt__  s    c         C` s   |  j  | d  d k S(   Nu   >=g        (   R-  (   R"   R%  (    (    s0   lib/python2.7/site-packages/astropy/time/core.pyt   __ge__  s    c         C` s+   |  j  d d  } | j | j j |   S(   NR/   u   datetime(   RK   R   RT   R   (   R"   t   timezoneR   (    (    s0   lib/python2.7/site-packages/astropy/time/core.pyt   to_datetime  s    N(T   R7   R8   R9   R   Rc   R   Rk   t   __array_priority__R(   t   _astropy_column_attrsR@   RL   RU   R'   R[   Rf   t   classmethodRu   R   R   R?   R/   t   setterR   R   R   RZ   RP   RQ   RR   R]   R   Rz   R{   R   R   R   RJ   R   Ra   Re   R   R   R   RI   RK   R   R   R   R   R   R   R   R   R   R   R   R
   R   R   R   R   R   R  R  R  R4   R  R   R5   R(  R)  R*  R+  R-  R.  R/  R1  R2  R3  R4  R6  R   R   (    (    (    s0   lib/python2.7/site-packages/astropy/time/core.pyRH      s   +						(%	+				1		R>	"		_		+	(	0#		&			0	'								R   c           B` s   e  Z d  Z e Z e Z e   Z d d d e
 d  Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d	   Z d
   Z d   Z d   Z d   Z d   Z RS(   u  
    Represent the time difference between two times.

    A TimeDelta object is initialized with one or more times in the ``val``
    argument.  The input times in ``val`` must conform to the specified
    ``format``.  The optional ``val2`` time input should be supplied only for
    numeric input formats (e.g. JD) where very high precision (better than
    64-bit precision) is required.

    The allowed values for ``format`` can be listed with::

      >>> list(TimeDelta.FORMATS)
      ['sec', 'jd']

    Note that for time differences, the scale can be among three groups:
    geocentric ('tai', 'tt', 'tcg'), barycentric ('tcb', 'tdb'), and rotational
    ('ut1'). Within each of these, the scales for time differences are the
    same. Conversion between geocentric and barycentric is possible, as there
    is only a scale factor change, but one cannot convert to or from 'ut1', as
    this requires knowledge of the actual times, not just their difference. For
    a similar reason, 'utc' is not a valid scale for a time difference: a UTC
    day is not always 86400 seconds.

    Parameters
    ----------
    val : sequence, ndarray, number, `~astropy.units.Quantity` or `~astropy.time.TimeDelta` object
        Value(s) to initialize the time difference(s). Any quantities will
        be converted appropriately (with care taken to avoid rounding
        errors for regular time units).
    val2 : sequence, ndarray, number, or `~astropy.units.Quantity`; optional
        Additional values, as needed to preserve precision.
    format : str, optional
        Format of input value(s)
    scale : str, optional
        Time scale of input value(s), must be one of the following values:
        ('tdb', 'tt', 'ut1', 'tcg', 'tcb', 'tai'). If not given (or
        ``None``), the scale is arbitrary; when added or subtracted from a
        ``Time`` instance, it will be used without conversion.
    copy : bool, optional
        Make a copy of the input values
    c         C` s|   t  | t  r. | d  k	 rx |  j |  qx nJ | d  k rC d } n  |  j | | | | |  | d  k	 rx t | |  _ n  d  S(   Nu   jd(   RJ   R   R(   RZ   R[   t   TIME_DELTA_TYPESRc   (   R"   RN   RO   R/   R   RI   (    (    s0   lib/python2.7/site-packages/astropy/time/core.pyR'     s    	c         O` s+   t  t |   j | |   } |  j | _ | S(   N(   R&   R   RK   Rc   (   R"   R   R   R$   (    (    s0   lib/python2.7/site-packages/astropy/time/core.pyRK     s    c      	   C` s   | |  j  k r d S| |  j k rF t d j | t |  j     n  t |  j  | f } | d k rt | |  j _  ns |  j j |  j j	 } } t
 | | d | \ } } |  j |  j | | | | | |  j |  j |  j d t |  _ d S(   u   
        This is the key routine that actually does time scale conversions.
        This is not public and not connected to the read-only scale property.
        Nu,   Scale {0!r} is not in the allowed scales {1}t   factorRv   (   R   Rc   R    R/   Re   t   SCALE_OFFSETSR(   RT   Rz   R{   R   Rk   RP   RQ   RR   R=   (   R"   R   t   scale_offsetRz   R{   t   offset1t   offset2(    (    s0   lib/python2.7/site-packages/astropy/time/core.pyRZ     s    	c         C` su  t  | t  r. t  | t  sd | j |   Sn6 y t |  } Wn# t k
 rc t |  | d   n X|  j d  k	 r |  j | j k s | j d  k	 r | j |  j k r t	 d j
 |  j | j    n  |  j d  k	 s | j d  k r|  j   } | j d  k	 r$t | |  j  } q$n | j   } |  j j | j j } |  j j | j j } t | |  \ | j _ | j _ | S(   Nu   +u:   Cannot add TimeDelta instances with scales '{0}' and '{1}'(   RJ   RH   R   R)  R^   R!  R   R(   Rc   Ro   R/   RK   RD   RT   Rz   R{   R   (   R"   R%  R$   Rz   R{   (    (    s0   lib/python2.7/site-packages/astropy/time/core.pyR)  &  s(    !!	!c         C` s}  t  | t  r6 t  | t  sl t |  | d   ql n6 y t |  } Wn# t k
 rk t |  | d   n X|  j d  k	 r |  j | j k s | j d  k	 r | j |  j k r t d j	 |  j | j    n  |  j d  k	 s | j d  k r |  j
   } | j d  k	 r,t | |  j  } q,n | j
   } |  j j | j j } |  j j | j j } t | |  \ | j _ | j _ | S(   Nu   -u?   Cannot subtract TimeDelta instances with scales '{0}' and '{1}'(   RJ   RH   R   R!  R^   R   R(   Rc   Ro   R/   RK   RD   RT   Rz   R{   R   (   R"   R%  R$   Rz   R{   (    (    s0   lib/python2.7/site-packages/astropy/time/core.pyR(  F  s(    !!	!c         C` s6   |  j    } |  j j | j _ |  j j | j _ | S(   u!   Negation of a `TimeDelta` object.(   RI   RT   Rz   R{   (   R"   t   new(    (    s0   lib/python2.7/site-packages/astropy/time/core.pyt   __neg__f  s    c         C` sq   |  j  j |  j  j } } | | d k  } |  j   } t j | | |  | j  _ t j | | |  | j  _ | S(   u'   Absolute value of a `TimeDelta` object.i    (   RT   Rz   R{   RI   RE   t   where(   R"   Rz   R{   t   negativeRA  (    (    s0   lib/python2.7/site-packages/astropy/time/core.pyt   __abs__m  s    c         C` s  t  | t  r$ t |  | d   n  y | j d  } Wn t k
 rJ n XyC t |  j |  j d | \ } } t | | d d d |  j	 } WnE t k
 r } y |  j t
 j  | SWq t k
 r |  q Xn X|  j d k r | j d |  j  } n  | S(   u8   Multiplication of `TimeDelta` objects by numbers/arrays.u   *i   R<  R/   u   jdR   (   RJ   RH   R!  R   R^   R   Rz   R{   R   R   R   t   dayR/   RK   (   R"   R%  Rz   R{   R$   t   err(    (    s0   lib/python2.7/site-packages/astropy/time/core.pyt   __mul__v  s"    !"c         C` s   |  j  |  S(   u:   Multiplication of numbers/arrays with `TimeDelta` objects.(   RH  (   R"   R%  (    (    s0   lib/python2.7/site-packages/astropy/time/core.pyt   __rmul__  s    c         C` s   |  j  |  S(   u2   Division of `TimeDelta` objects by numbers/arrays.(   t   __truediv__(   R"   R%  (    (    s0   lib/python2.7/site-packages/astropy/time/core.pyt   __div__  s    c         C` s   |  j  |  S(   u2   Division by `TimeDelta` objects of numbers/arrays.(   t   __rtruediv__(   R"   R%  (    (    s0   lib/python2.7/site-packages/astropy/time/core.pyt   __rdiv__  s    c         C` s   y | j  d  } Wn t k
 r& n XyC t |  j |  j d | \ } } t | | d d d |  j } WnE t k
 r } y |  j  t j  | SWq t k
 r |  q Xn X|  j	 d k r | j
 d |  j	  } n  | S(   u2   Division of `TimeDelta` objects by numbers/arrays.i   t   divisorR/   u   jdR   (   R   R^   R   Rz   R{   R   R   R   RF  R/   RK   (   R"   R%  Rz   R{   R$   RG  (    (    s0   lib/python2.7/site-packages/astropy/time/core.pyRJ    s    !"c         C` s   | |  j  t j  S(   u2   Division by `TimeDelta` objects of numbers/arrays.(   R   R   RF  (   R"   R%  (    (    s0   lib/python2.7/site-packages/astropy/time/core.pyRL    s    c         O` s/   t  j |  j j |  j j t  j  j | |   S(   N(   R   t   QuantityRT   Rz   R{   RF  R   (   R"   R   R   (    (    s0   lib/python2.7/site-packages/astropy/time/core.pyR     s    N(   R7   R8   R9   R#  Rc   R   Rk   RG   R   R(   R@   R'   RK   RZ   R)  R(  RB  RE  RH  RI  RK  RM  RJ  RL  R   (    (    (    s0   lib/python2.7/site-packages/astropy/time/core.pyR     s$   )				 	 									Rd   c           B` s   e  Z RS(    (   R7   R8   (    (    (    s0   lib/python2.7/site-packages/astropy/time/core.pyRd     s   c         C` s^   t  j |  d | d t }  |  j t  j k p< |  j j d k sZ t  j |  d t  j }  n  |  S(   u   
    Take ``val`` and convert/reshape to an array.  If ``copy`` is `True`
    then copy input values.

    Returns
    -------
    val : ndarray
        Array version of ``val``.
    RI   RW   u   OSUaRi   (   RE   R   R=   Ri   t   float64Rj   t
   asanyarray(   RN   RI   (    (    s0   lib/python2.7/site-packages/astropy/time/core.pyR_     s    
$R!  c           B` s   e  Z d d   Z RS(   c         C` sV   | d  k r d n d j |  } t t |   j d j | | j j | j j   d  S(   Nu    u    for {0}u/   Unsupported operand type(s){0}: '{1}' and '{2}'(   R(   R/   R&   R!  R'   RY   R7   (   R"   t   leftt   rightR,  t	   op_string(    (    s0   lib/python2.7/site-packages/astropy/time/core.pyR'     s    !	N(   R7   R8   R(   R'   (    (    (    s0   lib/python2.7/site-packages/astropy/time/core.pyR!    s   (M   R9   t
   __future__R    R   R   R   RI   R   R   t   collectionsR   t   numpyRE   t    R   R   R   R   R   R   R	   t   utils.decoratorsR
   t   utilsR   t   utils.compat.miscR   t   utils.data_infoR   R   t   utils.compat.numpyR   t   externR   t   extern.six.movesR   R   Rp   R   R   R   R   R   R   R   t   __all__R   R   t   GEOCENTRIC_SCALESt   BARYCENTRIC_SCALESt   ROTATIONAL_SCALESR   R;  R   R#  R(   t   ELGt   ELBR=  t   gmst06t   gmst00t   gmst82t   gst06at   gst00at   gst00bt   gst94R   R   RG   RH   R   R^   Rd   R@   R_   Ro   R!  (    (    (    s0   lib/python2.7/site-packages/astropy/time/core.pyt   <module>   s   ".		
"Q     