§
    ‡ÛgØ  ã                   ó\   — d Z ddlZddlZddlZddlZddlmZ ddlm	Z	  G d„ d¦  «        Z
dS )zEpoch module.é    N)Ú_api)Údate2numc                   ó|  — e Zd ZddiddidœZdd„Zd„ Zd	„ Zd
„ Zd„ Zd„ Z	 e
j        e	ej        ¦  «        Z e
j        e	ej        ¦  «        Z e
j        e	ej        ¦  «        Z e
j        e	ej        ¦  «        Z e
j        e	ej        ¦  «        Z e
j        e	ej        ¦  «        Zd„ Zd„ Zd„ Zd„ Zed„ ¦   «         ZdS )ÚEpochÚUTCg o�ÅP@ÚETg o�ÅPÀ)r   r   Nc           
      ój  — |€|€8|�|�4|�|€0|€.|€|€|�(|�&|�|€"|�|€|€|�5t          |t          j        ¦  «        st          d|›d|›d|›d|›�¦  «        ‚t	          j        | j        |¬¦  «         || _        |�t          |¦  «        }|�?t          |¦  «        dz   }t          j        |¦  «        | _        || j        z
  dz  | _        dS t          |¦  «        | _        t          |¦  «        | _        t          j        | j        d	z  ¦  «        }| xj        |z  c_        | xj        |dz  z  c_        dS )
a¢  
        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.
        NzlInvalid inputs.  Must enter sec and jd together, daynum by itself, or dt (must be a python datetime).
Sec = z
JD  = z
dnum= z
dt  = )Úframeg   €QD:Aç     õ@é€Q )Ú
isinstanceÚDTÚdatetimeÚ
ValueErrorr   Úcheck_in_listÚallowedÚ_framer   ÚfloatÚmathÚfloorÚ_jdÚ_seconds)Úselfr
   ÚsecÚjdÚdaynumÚdtÚ	deltaDayss          úX/granary/edev/quantum/lib/python3.11/site-packages/matplotlib/testing/jpl_units/Epoch.pyÚ__init__zEpoch.__init__   s^  € ð, ˆ[˜R˜^Ø� R ZØÐ#Ø�/ R ^Ø� B JØ�+  ØÐ#¨¨Ø� S _¸¸Ø�.­*°R½¼Ñ*EÔ*E�.Ý�*ð "˜c˜c 2 2 2 v v v¨r¨rð3ñ4ô 4ð 4õ 	Ô˜4œ<¨uÐ5Ñ5Ô5Ð5ØˆŒàˆ>Ý˜b‘\”\ˆFàÐå�v‘” Ñ*ˆBÝ”z "‘~”~ˆDŒHØ $¤(™]¨gÑ5ˆDŒMˆMˆMõ " #™JœJˆDŒMÝ˜R‘y”yˆDŒHõ œ
 4¤=°5Ñ#8Ñ9Ô9ˆIØˆHŒH˜	Ñ!ˆHŒHØˆMŒM˜Y¨Ñ0Ñ0ˆMŒMˆMˆMó    c                 óˆ   — | j         |k    r| S | j        | j                  |         }t          || j        |z   | j        ¦  «        S ©N)r   r   r   r   r   )r   r
   Úoffsets      r   ÚconvertzEpoch.convertT   sB   € ØŒ;˜%ÒÐØˆKà”˜dœkÔ*¨5Ô1ˆå�U˜DœM¨FÑ2°D´HÑ=Ô=Ð=r!   c                 ó   — | j         S r#   )r   ©r   s    r   r
   zEpoch.frame\   s
   € ØŒ{Ðr!   c                 ój   — | }|| j         k    r|                      |¦  «        }|j        |j        dz  z   S )Nr   ©r   r%   r   r   )r   r
   Úts      r   Ú
julianDatezEpoch.julianDate_   s9   € ØˆØ�D”KÒÐØ—’˜UÑ#Ô#ˆAàŒu�q”z GÑ+Ñ+Ð+r!   c                 ót   — | }|| j         k    r|                      |¦  «        }|j        |z
  }|j        |dz  z   S )Nr   r)   )r   r
   r   r*   Údeltas        r   ÚsecondsPastzEpoch.secondsPastf   sA   € ØˆØ�D”KÒÐØ—’˜UÑ#Ô#ˆAà”˜‘
ˆØŒz˜E E™MÑ)Ð)r!   c                 óÒ   — | }| j         |j         k    r|                      |j         ¦  «        }|j        |j        k    r ||j        |j        ¦  «        S  ||j        |j        ¦  «        S )z4Compare Epochs *self* and *rhs* using operator *op*.r)   )r   ÚopÚrhsr*   s       r   Ú_cmpz
Epoch._cmpn   sd   € àˆØŒ;˜#œ*Ò$Ð$Ø—’˜SœZÑ(Ô(ˆAØŒ5�C”GÒÐØ�2�a”e˜SœWÑ%Ô%Ð%Øˆr�!”*˜cœlÑ+Ô+Ð+r!   c                 óâ   — | }| j         |                     ¦   «         k    r|                      |j         ¦  «        }|j        |                     ¦   «         z   }t          |j         ||j        ¦  «        S )zÌ
        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   r
   r%   r   Úsecondsr   r   )r   r1   r*   r   s       r   Ú__add__zEpoch.__add__~   s[   € ð ˆØŒ;˜#Ÿ)š)™+œ+Ò%Ð%Ø—’˜SœZÑ(Ô(ˆAàŒj˜3Ÿ;š;™=œ=Ñ(ˆå�Q”X˜s A¤EÑ*Ô*Ð*r!   c                 ó   — ddl mc m} t          ||j        ¦  «        r| | z   S | }| j        |j        k    r|                      |j        ¦  «        }|j        |j        z
  }|j        |j        z
  }|                     |j        |dz  |z   ¦  «        S )aƒ  
        Subtract 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.
        r   Nr   )	Úmatplotlib.testing.jpl_unitsÚtestingÚ	jpl_unitsr   ÚDurationr   r%   r   r   )r   r1   ÚUr*   Údaysr   s         r   Ú__sub__zEpoch.__sub__�   s¢   € ð  	1Ð0Ð0Ð0Ð0Ð0Ð0Ð0Ð0õ �c˜1œ:Ñ&Ô&ð 	Ø˜3˜$‘;ÐàˆØŒ;˜#œ*Ò$Ð$Ø—’˜SœZÑ(Ô(ˆAàŒu�s”w‰ˆØŒj˜3œ<Ñ'ˆà�zŠz˜#œ* d¨5¡j°3Ñ&6Ñ7Ô7Ð7r!   c                 óJ   — d|                       | j        ¦  «        | j        fz  S )úPrint the Epoch.z
%22.15e %s)r+   r   r'   s    r   Ú__str__zEpoch.__str__¯   s"   € à˜tŸš¨t¬{Ñ;Ô;¸T¼[ÐIÑIÐIr!   c                 ó    — t          | ¦  «        S )r?   )Ústrr'   s    r   Ú__repr__zEpoch.__repr__³   s   € å�4‰yŒyÐr!   c                 ód   — g }d}	 | ||z  z   }||k    rn|                      |¦  «         |dz  }Œ*|S )aÌ  
        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 containing the requested Epoch values.
        r   Té   )Úappend)ÚstartÚstopÚstepÚelemsÚiÚds         r   ÚrangezEpoch.range·   sQ   € ð" ˆàˆð	Ø˜˜D™Ñ ˆAØ�DŠyˆyØà�LŠL˜‰OŒOˆOØ�‰FˆAð	ð ˆr!   )NNNN)Ú__name__Ú
__module__Ú__qualname__r   r    r%   r
   r+   r.   r2   Ú	functoolsÚpartialmethodÚoperatorÚeqÚ__eq__ÚneÚ__ne__ÚltÚ__lt__ÚleÚ__le__ÚgtÚ__gt__ÚgeÚ__ge__r5   r=   r@   rC   ÚstaticmethodrM   © r!   r   r   r      sx  € € € € € ð
 �8ðð �(ðð	
ð 
€Gð:1ð :1ð :1ð :1ðx>ð >ð >ðð ð ð,ð ,ð ,ð*ð *ð *ð,ð ,ð ,ð %ˆYÔ$ T¨8¬;Ñ7Ô7€FØ$ˆYÔ$ T¨8¬;Ñ7Ô7€FØ$ˆYÔ$ T¨8¬;Ñ7Ô7€FØ$ˆYÔ$ T¨8¬;Ñ7Ô7€FØ$ˆYÔ$ T¨8¬;Ñ7Ô7€FØ$ˆYÔ$ T¨8¬;Ñ7Ô7€Fð+ð +ð +ð$8ð 8ð 8ð>Jð Jð Jðð ð ð ðð ñ „\ðð ð r!   r   )Ú__doc__rQ   rS   r   r   r   Ú
matplotlibr   Úmatplotlib.datesr   r   ra   r!   r   ú<module>re      s•   ðØ Ð à Ð Ð Ð Ø €€€Ø €€€Ø Ð Ð Ð à Ð Ð Ð Ð Ð Ø %Ð %Ð %Ð %Ð %Ð %ðGð Gð Gð Gð Gñ Gô Gð Gð Gð Gr!   