File: //opt/alt/python27/lib64/python2.7/site-packages/matplotlib/testing/jpl_units/UnitDblConverter.pyc
�
_�3Lc @ s� d Z d d l Z d d l j Z d d l j Z d d l j j Z d d l
m Z d g Z d d � Z d e j f d � � YZ d S( s: UnitDblConverter module containing class UnitDblConverter.i����N( t iterablet UnitDblConverterc C s t | t j d d � } | d k r1 t | � S| d k rA d S| d k rQ d S| d d k rp d | d f Sd | f Sd
S( s Radian function formatter.g @g �?i i s $\pi/2$i s $\pi$s $%s\pi$s $%s\pi/2$N( t intt npt pit str( t xt post n( ( s` /opt/alt/python27/lib64/python2.7/site-packages/matplotlib/testing/jpl_units/UnitDblConverter.pyt rad_fn s
c B sV e Z d Z i d d 6d d 6d d 6Z e d � � Z e d � � Z e d � � Z RS(
sv : A matplotlib converter class. Provides matplotlib conversion
functionality for the Monte UnitDbl class.
t kmt distancet degt anglet sect timec C s� d d l j j } | r? t | t � r0 | } qE | j � } n d } | d k rc t j t � } nE | d k r� t | j
t j � r� t j j
� } n | j d t � } t j d | d | � S( sV : Returns information on how to handle an axis that has Epoch data.
= INPUT VARIABLES
- unit The units to use for a axis with Epoch data.
= RETURN VALUE
- Returns a matplotlib AxisInfo data structure that contains
minor/major formatters, major/minor locators, and default
label information.
i����Nt radR t useOffsett majfmtt label( t matplotlib.testing.jpl_unitst testingt jpl_unitst
isinstanceR R t Nonet tickert
FuncFormatterR t axest polart PolarAxest ThetaFormattert UnitDblFormattert Falset unitst AxisInfo( t unitt axist UR R ( ( s` /opt/alt/python27/lib64/python2.7/site-packages/matplotlib/testing/jpl_units/UnitDblConverter.pyt axisinfo8 s
!c C s d d l j j } t } t | � rs t | t � rs t | � d k rJ g Sg | D] } t j | | | � ^ qQ Sn t | | j
� r� t } n | r� t j
j | � r� | S| d k r� t j | | � } n t | j t j � r� | j � d k r� | j d � S| j | � S( sW : Convert value using unit to a float. If value is a sequence, return
the converted sequence.
= INPUT VARIABLES
- value The value or list of values that need to be converted.
- unit The units to use for a axis with Epoch data.
= RETURN VALUE
- Returns the value parameter converted to floats.
i����Ni R
R ( R R R t TrueR R R t lenR t convertt UnitDblR R! t ConversionInterfacet
is_numlikeR t
default_unitsR R R t type( t valueR# R$ R% t isNotUnitDblR ( ( s` /opt/alt/python27/lib64/python2.7/site-packages/matplotlib/testing/jpl_units/UnitDblConverter.pyR) _ s
) '
c C sE t | � r0 t | t � r0 t j | d | � St j | j � Sd S( s : Return the default unit for value, or None.
= INPUT VARIABLES
- value The value or list of values that need units.
= RETURN VALUE
- Returns the default units to use for value.
Return the default unit for value, or None.
i N( R R R R R- t defaultsR. ( R/ R$ ( ( s` /opt/alt/python27/lib64/python2.7/site-packages/matplotlib/testing/jpl_units/UnitDblConverter.pyR- � s ( t __name__t
__module__t __doc__R1 t staticmethodR&