
    h                     T    S r SSKJrJr  SSKJr  S/r " S S\R                  5      r	g)z6EpochConverter module containing class EpochConverter.    )cbookunitsNEpochConverterc                   |    \ rS rSrSrSr\S 5       r\S 5       r\S 5       r	\S 5       r
\S 5       r\S	 5       rS
rg)r   	   zT
Provides Matplotlib conversion functionality for Monte Epoch and Duration
classes.
g   QD:Ac                     [         R                  " 5       n[         R                  " U5      n[        R                  " X#U S9$ )N)majlocmajfmtlabel)date_tickerAutoDateLocatorAutoDateFormatterr   AxisInfo)unitaxisr	   r
   s       ]/var/www/html/env/lib/python3.13/site-packages/matplotlib/testing/jpl_units/EpochConverter.pyaxisinfoEpochConverter.axisinfo   s3     ,,...v6~~V$GG    c                     SSK Js  Jn  U S-  UR                  SS5      -  nUR	                  X[
        R                  5      $ )a  
Convert a Matplotlib floating-point date into an Epoch of the specified
units.

= INPUT VARIABLES
- value     The Matplotlib floating-point date.
- unit      The unit system to use for the Epoch.

= RETURN VALUE
- Returns the value converted to an Epoch in the specified time system.
r   N     @g      ?sec)matplotlib.testing.jpl_unitstesting	jpl_unitsUnitDblEpochr   jdRef)valuer   U
secPastRefs       r   float2epochEpochConverter.float2epoch   s:     	10W_qyye'<<
wwt)=)=>>r   c                 F    U R                  U5      [        R                  -
  $ )a&  
Convert an Epoch value to a float suitable for plotting as a python
datetime object.

= INPUT VARIABLES
- value    An Epoch or list of Epochs that need to be converted.
- unit     The units to use for an axis with Epoch data.

= RETURN VALUE
- Returns the value parameter converted to floats.
)
julianDater   r   )r   r   s     r   epoch2floatEpochConverter.epoch2float+   s      %(<(<<<r   c                 (    U R                  5       S-  $ )z
Convert a Duration value to a float suitable for plotting as a python
datetime object.

= INPUT VARIABLES
- value    A Duration or list of Durations that need to be converted.

= RETURN VALUE
- Returns the value parameter converted to floats.
r   )seconds)r   s    r   duration2floatEpochConverter.duration2float:   s     }}((r   c                 Z   SS K Js  Jn  [        R                  " U 5      (       d'  U  Vs/ s H  n[
        R                  XAU5      PM     sn$ Uc  [
        R                  X5      n[        XR                  5      (       a  [
        R                  U 5      $ [
        R                  X5      $ s  snf Nr   )r   r   r   r   is_scalar_or_stringr   convertdefault_units
isinstanceDurationr*   r&   )r   r   r   r    xs        r   r/   EpochConverter.convertH   s    
 	10((//CHI5aN**1D95II<!//<DeZZ((!0077!--e:: Js    B(c                     [         R                  " U 5      (       a  U R                  5       $ [        R	                  U S   U5      $ r-   )r   r.   framer   r0   )r   r   s     r   r0   EpochConverter.default_unitsX   s8     $$U++;;= !//a$??r    N)__name__
__module____qualname____firstlineno____doc__r   staticmethodr   r"   r&   r*   r/   r0   __static_attributes__r8   r   r   r   r   	   s    
 EH H ? ?$ = = ) ) ; ; @ @r   )
r=   
matplotlibr   r   matplotlib.datesdatesr   __all__ConversionInterfacer   r8   r   r   <module>rE      s,    < # &
U@U.. U@r   