Ë
    ¨ehÔ  ã                   óT   — 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
y)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y)ÚEpochÚUTCg o�ÅP@ÚETg o�ÅPÀ)r   r   Nc           
      óv  — |€|€8|�|�4|�|€0|€.|€|€|�(|�&|�|€"|�|€|€|�1t        |t        j                  «      st        d|›d|›d|›d|›�«      ‚t	        j
                  | j                  |¬«       || _        |�t        |«      }|�@t        |«      dz   }t        j                  |«      | _        || j                  z
  dz  | _        yt        |«      | _        t        |«      | _        t        j                  | j                  d	z  «      }| xj                  |z  c_        | xj                  |dz  z  c_        y)
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          ú`/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/matplotlib/testing/jpl_units/Epoch.pyÚ__init__zEpoch.__init__   s1  € ð, ˆ[˜R˜^Ø� R ZØÐ#Ø�/ R ^Ø� B JØ�+  ØÐ#¨¨Ø� S _¸¸Ø�.¬*°R¼¿¹Ô*EÝò "¢2¢v©rð3ó4ð 4ô 	×Ñ˜4Ÿ<™<¨uÕ5ØˆŒàˆ>Ü˜b“\ˆFàÐä�v“ Ñ*ˆBÜ—z‘z "“~ˆDŒHØ $§(¡(™]¨gÑ5ˆD�Mô " #›JˆDŒMÜ˜R“yˆDŒHô Ÿ
™
 4§=¡=°5Ñ#8Ó9ˆIØ�HŠH˜	Ñ!�HØ�MŠM˜Y¨Ñ0Ñ0Ž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   sF   € Ø�;‰;˜%ÒØˆKà—‘˜dŸk™kÑ*¨5Ñ1ˆä�U˜DŸM™M¨FÑ2°D·H±HÓ=Ð=r!   c                 ó   — | j                   S r#   )r   ©r   s    r   r
   zEpoch.frame\   s   € Ø�{‰{Ðr!   c                 ó~   — | }|| j                   k7  r| j                  |«      }|j                  |j                  dz  z   S )Nr   ©r   r%   r   r   )r   r
   Úts      r   Ú
julianDatezEpoch.julianDate_   s9   € ØˆØ�D—K‘KÒØ—‘˜UÓ#ˆAà�u‰u�q—z‘z GÑ+Ñ+Ð+r!   c                 óˆ   — | }|| j                   k7  r| j                  |«      }|j                  |z
  }|j                  |dz  z   S )Nr   r)   )r   r
   r   r*   Údeltas        r   ÚsecondsPastzEpoch.secondsPastf   sA   € ØˆØ�D—K‘KÒØ—‘˜UÓ#ˆAà—‘˜‘
ˆØ�z‰z˜E E™MÑ)Ð)r!   c                 ó  — | }| j                   |j                   k7  r| j                  |j                   «      }|j                  |j                  k7  r ||j                  |j                  «      S  ||j                  |j                  «      S )z4Compare Epochs *self* and *rhs* using operator *op*.r)   )r   ÚopÚrhsr*   s       r   Ú_cmpz
Epoch._cmpn   sc   € àˆØ�;‰;˜#Ÿ*™*Ò$Ø—‘˜SŸZ™ZÓ(ˆAØ�5‰5�C—G‘GÒÙ�a—e‘e˜SŸW™WÓ%Ð%Ù�!—*‘*˜cŸl™lÓ+Ð+r!   c                 óò   — | }| j                   |j                  «       k7  r| j                  |j                   «      }|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__~   sX   € ð ˆØ�;‰;˜#Ÿ)™)›+Ò%Ø—‘˜SŸZ™ZÓ(ˆAà�j‰j˜3Ÿ;™;›=Ñ(ˆä�Q—X‘X˜s A§E¡EÓ*Ð*r!   c                 ó`  — ddl mc m} t        ||j                  «      r| | z   S | }| j
                  |j
                  k7  r| j                  |j
                  «      }|j                  |j                  z
  }|j                  |j                  z
  }|j	                  |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ô �c˜1Ÿ:™:Ô&Ø˜3˜$‘;ÐàˆØ�;‰;˜#Ÿ*™*Ò$Ø—‘˜SŸZ™ZÓ(ˆAà�u‰u�s—w‘w‰ˆØ�j‰j˜3Ÿ<™<Ñ'ˆà�z‰z˜#Ÿ*™* d¨5¡j°3Ñ&6Ó7Ð7r!   c                 óX   — | j                  | j                  «      d›d| j                  › �S )úPrint the Epoch.z22.15eú )r+   r   r'   s    r   Ú__str__zEpoch.__str__¯   s'   € à—/‘/ $§+¡+Ó.¨vÐ6°a¸¿¹°}ÐEÐEr!   c                 ó   — t        | «      S )r?   )Ústrr'   s    r   Ú__repr__zEpoch.__repr__³   s   € ä�4‹yÐr!   c                 óZ   — g }d}	 | ||z  z   }||k\  r	 |S |j                  |«       |dz  }Œ')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   é   )Úappend)ÚstartÚstopÚstepÚelemsÚiÚds         r   ÚrangezEpoch.range·   sK   € ð" ˆàˆØØ˜˜D™Ñ ˆAØ�DŠyØð
 ˆð �L‰L˜Œ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=   rA   rD   ÚstaticmethodrN   © r!   r   r   r      sû   „ ð
 �8ðð �(ðñ	
€Gó:1òx>òò,ò*ò,ð %ˆY×$Ñ$ T¨8¯;©;Ó7€FØ$ˆY×$Ñ$ T¨8¯;©;Ó7€FØ$ˆY×$Ñ$ T¨8¯;©;Ó7€FØ$ˆY×$Ñ$ T¨8¯;©;Ó7€FØ$ˆY×$Ñ$ T¨8¯;©;Ó7€FØ$ˆY×$Ñ$ T¨8¯;©;Ó7€Fò+ò$8ò>Fòð ñó ñr!   r   )Ú__doc__rR   rT   r   r   r   Ú
matplotlibr   Úmatplotlib.datesr   r   rb   r!   r   ú<module>rf      s&   ðÙ ã Û Û Û å Ý %÷Gò Gr!   