HEX
Server: LiteSpeed
System: Linux standart9.isimtescil.net 3.10.0-962.3.2.lve1.5.26.7.el7.x86_64 #1 SMP Wed Oct 2 07:53:12 EDT 2019 x86_64
User: karalev (5310)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: //opt/alt/python27/lib64/python2.7/site-packages/matplotlib/testing/jpl_units/Epoch.pyc
�
_�3Lc@sEdZddlZddlZddlmZddd��YZdS(s
Epoch module.i����N(tdate2numtEpochcBs�eZiid
d6d6idd6d6Zddddd�Zd�Zd�Zd�Zd�Zd	�Z	d
�Z
d�Zd�Zd
�Z
d�Zee�ZRS(go��P@tUTCtETgo��P�cCs"|dkr|dk	s�|dk	r0|dks�|dk	rT|dk	s�|dk	s�|dkr�|dkr�|dks�|dks�|dk	r�|dk	s�|dk	r�|dk	s�|dk	s�|dk	rt|tj�rdt|�t|�t|�t|�f}t|��n||jkrYd|t|jj��f}t|��n||_|dk	r}t	|�}n|dk	r�t
|�d}tj|�|_
||j
d|_n\t
|�|_t
|�|_
ttj|jd��}|j
|7_
|j|d8_dS(s�Create a new Epoch object.

      Build an epoch 1 of 2 ways:

      Using seconds past a Julian date:
      #   Epoch( 'ET', sec=1e8, jd=2451545 )

      or using a matplotlib day number
      #   Epoch( 'ET', daynum=730119.5 )
      
      
      = ERROR CONDITIONS
      - If the input units are not in the allowed list, an error is thrown.

      = INPUT VARIABLES
      - frame    The frame of the epoch.  Must be 'ET' or 'UTC'
      - sec      The number of seconds past the input JD.
      - jd       The Julian date of the epoch.
      - daynum   The matplotlib day number of the epoch.
      - dt       A python datetime instance.
      s�Invalid inputs.  Must enter sec and jd together, daynum by itself, or dt (must be a python datetime).
Sec = %s
JD  = %s
dnum= %s
dt  = %ss9Input frame '%s' is not one of the supported frames of %sg�QD:Ag�@N(tNonet
isinstancetDTtdatetimetstrt
ValueErrortallowedtkeyst_frameRtfloattmathtfloort_jdt_secondstint(tselftframetsectjdtdaynumtdttmsgt	deltaDays((sU/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/testing/jpl_units/Epoch.pyt__init__!s4$0$+	cCsA|j|kr|S|j|j|}t||j||j�S(N(RR
RRR(RRtoffset((sU/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/testing/jpl_units/Epoch.pytconvert^scCs|jS(N(R(R((sU/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/testing/jpl_units/Epoch.pyRgscCs9|}||jkr'|j|�}n|j|jdS(Ng�@(RRRR(RRtt((sU/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/testing/jpl_units/Epoch.pyt
julianDatekscCsC|}||jkr'|j|�}n|j|}|j|dS(Ni�Q(RRRR(RRRRtdelta((sU/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/testing/jpl_units/Epoch.pytsecondsPastss

cCse|}|j|jkr-|j|j�}n|j|jkrRt|j|j�St|j|j�S(s�Compare two Epoch's.

      = INPUT VARIABLES
      - rhs    The Epoch to compare against.

      = RETURN VALUE
      - Returns -1 if self < rhs, 0 if self == rhs, +1 if self > rhs.
      (RRRtcmpR(RtrhsR((sU/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/testing/jpl_units/Epoch.pyt__cmp__|s	cCsY|}|j|j�kr0|j|j�}n|j|j�}t|j||j�S(s�Add a duration to an Epoch.

      = INPUT VARIABLES
      - rhs    The Epoch to subtract.

      = RETURN VALUE
      - Returns the difference of ourselves and the input Epoch.
      (RRRRtsecondsRR(RR#RR((sU/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/testing/jpl_units/Epoch.pyt__add__�s
	cCs�ddljj}t||j�r-||S|}|j|jkrZ|j|j�}n|j|j}|j|j}|j|j|d|�S(sgSubtract two Epoch's or a Duration from an Epoch.

      Valid:
      Duration = Epoch - Epoch
      Epoch = Epoch - Duration

      = INPUT VARIABLES
      - rhs    The Epoch to subtract.

      = RETURN VALUE
      - Returns either the duration between to Epoch's or the a new
        Epoch that is the result of subtracting a duration from an epoch.
      i����Ni�Q(	tmatplotlib.testing.jpl_unitsttestingt	jpl_unitsRtDurationRRRR(RR#tURtdaysR((sU/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/testing/jpl_units/Epoch.pyt__sub__�s	cCsd|j|j�|jfS(sPrint the Epoch.s
%22.15e %s(RR(R((sU/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/testing/jpl_units/Epoch.pyt__str__�scCs
t|�S(sPrint the Epoch.(R(R((sU/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/testing/jpl_units/Epoch.pyt__repr__�scCsRg}d}x?trM|||}||kr3Pn|j|�|d7}qW|S(s�Generate a range of Epoch objects.

      Similar to the Python range() method.  Returns the range [
      start, stop ) at the requested step.  Each element will be a
      Epoch object.
      
      = INPUT VARIABLES
      - start    The starting value of the range.  
      - stop     The stop value of the range.  
      - step     Step to use.  
                 
      = RETURN VALUE
      - Returns a list contianing the requested Epoch values.
      ii(tTruetappend(tstarttstoptsteptelemstitd((sU/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/testing/jpl_units/Epoch.pytrange�s	
N(t__name__t
__module__R
RRRRRR!R$R&R-R.R/R8tstaticmethod(((sU/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/testing/jpl_units/Epoch.pyRs"=												((t__doc__RRRtmatplotlib.datesRR(((sU/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/testing/jpl_units/Epoch.pyt<module>s