File: //opt/alt/python27/lib64/python2.7/site-packages/matplotlib/testing/jpl_units/Epoch.pyc
�
_�3Lc @ sE d Z d d l Z d d l Z d d l m Z d d d � � YZ d S( s
Epoch module.i����N( t date2numt Epochc B s� e Z i i d
d 6d 6i d d 6d 6Z d d d d d � Z d � Z d � Z d � Z d � Z d � Z d
� Z
d � Z d � Z d
� Z
d � Z e e � Z RS( g o��P@t UTCt ETg o��P�c C s" | d k r | d k s� | d k r0 | d k s� | d k rT | d k s� | d k s� | d k r� | d k r� | d k s� | d k s� | d k r� | d k s� | d k r� | d k s� | d k s� | d k rt | t j � rd t | � t | � t | � t | � f } t | � � n | | j k rYd | t | j j � � f } t | � � n | | _ | d k r}t | � } n | d k r�t
| � d } t j | � | _
| | j
d | _ n\ t
| � | _ t
| � | _
t t j | j d � � } | j
| 7_
| j | d 8_ d S( 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 = %ss9 Input frame '%s' is not one of the supported frames of %sg �QD:Ag �@N( t Nonet
isinstancet DTt datetimet strt
ValueErrort allowedt keyst _frameR t floatt matht floort _jdt _secondst int( t selft framet sect jdt daynumt dtt msgt deltaDays( ( sU /opt/alt/python27/lib64/python2.7/site-packages/matplotlib/testing/jpl_units/Epoch.pyt __init__! s4 $0$+ c C sA | j | k r | S| j | j | } t | | j | | j � S( N( R R
R R R ( R R t offset( ( sU /opt/alt/python27/lib64/python2.7/site-packages/matplotlib/testing/jpl_units/Epoch.pyt convert^ s c C s | j S( N( R ( R ( ( sU /opt/alt/python27/lib64/python2.7/site-packages/matplotlib/testing/jpl_units/Epoch.pyR g s c C s9 | } | | j k r'