ó
ÄCõRc        )   @  sN  d  Z  d d l m 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	 Z	 d d l
 m Z m Z m Z m Z m Z m Z m Z m Z m Z m Z m Z m Z m Z m Z m Z d d l m Z d d l Z d d l Z d d l  Z  d d l! j" Z" d d l# j$ Z$ d d l% j& Z& db Z' d0 e j( f d1 „  ƒ  YZ) e) ƒ  Z* d2 „  Z+ e d3 Z, d4 Z- d5 e- Z. d5 e. Z/ d6 e/ Z0 d7 Z1 d8 Z2 e2 d9 Z3 e3 d: Z4 e e e e e e e f \ Z5 Z6 Z7 Z8 Z9 Z: Z; e5 e6 e7 e8 e9 e: e; f Z< d; „  Z= d d< „ Z? d= dc d> „  ƒ  YZ@ d? „  ZA d@ „  ZB dA „  ZC dB „  ZD d dC „ ZE dD „  ZF d e& jG f dE „  ƒ  YZH d e& jG f dF „  ƒ  YZI d e& jG f dG „  ƒ  YZJ dH dd dI „  ƒ  YZK d e& jL f dJ „  ƒ  YZM d eM f dK „  ƒ  YZN d eM f dL „  ƒ  YZO d eM f dM „  ƒ  YZP d eN f dN „  ƒ  YZQ d eN f dO „  ƒ  YZR d eN f dP „  ƒ  YZS d eN f dQ „  ƒ  YZT d eN f dR „  ƒ  YZU d eN f dS „  ƒ  YZV d eM f dT „  ƒ  YZW dU dV „ ZX dU dW „ ZY dX „  ZZ dY „  Z[ dZ „  Z\ d dU d[ „ Z] d\ „  Z^ d] „  Z_ d^ „  Z` d_ „  Za d` e" jb f da „  ƒ  YZc ec ƒ  e" jd e je <ec ƒ  e" jd e j <d S(e   s	  
Matplotlib provides sophisticated date plotting capabilities, standing on the
shoulders of python :mod:`datetime`, the add-on modules :mod:`pytz` and
:mod:`dateutils`.  :class:`datetime` objects are converted to floating point
numbers which represent time in days since 0001-01-01 UTC, plus 1.  For
example, 0001-01-01, 06:00 is 1.25, not 0.25.  The helper functions
:func:`date2num`, :func:`num2date` and :func:`drange` are used to facilitate
easy conversion to and from :mod:`datetime` and numeric ranges.

.. note::

   Like Python's datetime, mpl uses the Gregorian calendar for all
   conversions between dates and floating point numbers. This practice
   is not universal, and calendar differences can cause confusing
   differences between what Python and mpl give as the number of days
   since 0001-01-01 and what other software and databases yield.  For
   example, the US Naval Observatory uses a calendar that switches
   from Julian to Gregorian in October, 1582.  Hence, using their
   calculator, the number of days between 0001-01-01 and 2006-04-01 is
   732403, whereas using the Gregorian calendar via the datetime
   module we find::

     In [31]:date(2006,4,1).toordinal() - date(1,1,1).toordinal()
     Out[31]:732401


A wide range of specific and general purpose date tick locators and
formatters are provided in this module.  See
:mod:`matplotlib.ticker` for general information on tick locators
and formatters.  These are described below.

All the matplotlib date converters, tickers and formatters are
timezone aware, and the default timezone is given by the timezone
parameter in your :file:`matplotlibrc` file.  If you leave out a
:class:`tz` timezone instance, the default from your rc file will be
assumed.  If you want to use a custom time zone, pass a
:class:`pytz.timezone` instance with the tz keyword argument to
:func:`num2date`, :func:`plot_date`, and any custom date tickers or
locators you create.  See `pytz <http://pytz.sourceforge.net>`_ for
information on :mod:`pytz` and timezone handling.

The `dateutil module <http://labix.org/python-dateutil>`_ provides
additional code to handle date ticking, making it easy to place ticks
on any kinds of dates.  See examples below.

Date tickers
------------

Most of the date tickers can locate single or multiple values.  For
example::

    # tick on mondays every week
    loc = WeekdayLocator(byweekday=MO, tz=tz)

    # tick on mondays and saturdays
    loc = WeekdayLocator(byweekday=(MO, SA))

In addition, most of the constructors take an interval argument::

    # tick on mondays every second week
    loc = WeekdayLocator(byweekday=MO, interval=2)

The rrule locator allows completely general date ticking::

    # tick every 5th easter
    rule = rrulewrapper(YEARLY, byeaster=1, interval=5)
    loc = RRuleLocator(rule)

Here are all the date tickers:

    * :class:`MinuteLocator`: locate minutes

    * :class:`HourLocator`: locate hours

    * :class:`DayLocator`: locate specifed days of the month

    * :class:`WeekdayLocator`: Locate days of the week, eg MO, TU

    * :class:`MonthLocator`: locate months, eg 7 for july

    * :class:`YearLocator`: locate years that are multiples of base

    * :class:`RRuleLocator`: locate using a
      :class:`matplotlib.dates.rrulewrapper`.  The
      :class:`rrulewrapper` is a simple wrapper around a
      :class:`dateutil.rrule` (`dateutil
      <http://labix.org/python-dateutil>`_) which allow almost
      arbitrary date tick specifications.  See `rrule example
      <../examples/pylab_examples/date_demo_rrule.html>`_.

    * :class:`AutoDateLocator`: On autoscale, this class picks the best
      :class:`MultipleDateLocator` to set the view limits and the tick
      locations.

Date formatters
---------------

Here all all the date formatters:

    * :class:`AutoDateFormatter`: attempts to figure out the best format
      to use.  This is most useful when used with the :class:`AutoDateLocator`.

    * :class:`DateFormatter`: use :func:`strftime` format strings

    * :class:`IndexDateFormatter`: date plots with implicit *x*
      indexing.
iÿÿÿÿ(   t   print_functionN(   t   izip(   t   rrulet   MOt   TUt   WEt   THt   FRt   SAt   SUt   YEARLYt   MONTHLYt   WEEKLYt   DAILYt   HOURLYt   MINUTELYt   SECONDLY(   t   relativedeltat   date2numt   num2datet   dranget	   epoch2numt	   num2epocht   mx2numt   DateFormattert   IndexDateFormattert   AutoDateFormattert   DateLocatort   RRuleLocatort   AutoDateLocatort   YearLocatort   MonthLocatort   WeekdayLocatort
   DayLocatort   HourLocatort   MinuteLocatort   SecondLocatort   MicrosecondLocatorR   R   R   R   R   R   R   R	   R
   R   R   R   R   R   R   t   MICROSECONDLYR   t   secondst   minutest   hourst   weekst   _UTCc           B  s)   e  Z d  Z d „  Z d „  Z d „  Z RS(   t   UTCc         C  s   t  j d ƒ S(   Ni    (   t   datetimet	   timedelta(   t   selft   dt(    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyt	   utcoffset˜   s    c         C  s   d S(   NR,   (    (   R/   R0   (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyt   tzname›   s    c         C  s   t  j d ƒ S(   Ni    (   R-   R.   (   R/   R0   (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyt   dstž   s    (   t   __name__t
   __module__t   __doc__R1   R2   R3   (    (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyR+   •   s   		c          C  s6   t  j d }  |  d k r t Sd d  l } | j |  ƒ S(   Nt   timezoneR,   iÿÿÿÿ(   t
   matplotlibt   rcParamsR,   t   pytzR7   (   t   sR:   (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyt   _get_rc_timezone¤   s
    i   g      8@g      N@g    €„.Ai<   i  i   i   c         C  s¦   t  |  d ƒ rL |  j d k	 rL |  j j |  ƒ } | d k	 rL |  | 8}  qL n  t |  j ƒ  ƒ } t  |  d ƒ r¢ | |  j t |  j t	 |  j
 t |  j t 7} n  | S(   s©   
    Convert :mod:`datetime` to the Gregorian date as UTC float days,
    preserving hours, minutes, seconds and microseconds.  Return value
    is a :func:`float`.
    t   tzinfot   hourN(   t   hasattrR=   t   NoneR1   t   floatt	   toordinalR>   t   HOURS_PER_DAYt   minutet   MINUTES_PER_DAYt   secondt   SECONDS_PER_DAYt   microsecondt   MUSECONDS_PER_DAY(   R0   t   deltat   base(    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyt   _to_ordinalf¹   s     c   	   
   C  s.  | d
 k r t ƒ  } n  t |  ƒ } t j j | ƒ } t |  ƒ | } t d | d ƒ \ } } t d | d ƒ \ } } t d | d ƒ \ } } t d | ƒ } | d k  r¶ d } n  t j | j | j | j	 t | ƒ t | ƒ t | ƒ | d t
 ƒj | ƒ } | d k r*| t j d	 d | ƒ 7} n  | S(   s�   
    Convert Gregorian float of the date, preserving hours, minutes,
    seconds and microseconds.  Return value is a :class:`datetime`.
    i   i   i<   g    €„.Ai
   i    R=   i6B t   microsecondsN(   R@   R<   t   intR-   t   fromordinalRA   t   divmodt   yeart   montht   dayR,   t
   astimezoneR.   (	   t   xt   tzt   ixR0   t	   remainderR>   RD   RF   RH   (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyt   _from_ordinalfÎ   s"    	-t   strpdate2numc           B  s    e  Z d  Z d „  Z d „  Z RS(   s³   
    Use this class to parse date strings to matplotlib datenums when
    you know the date format string of the date you are parsing.  See
    :file:`examples/load_demo.py`.
    c         C  s   | |  _  d S(   s-    fmt: any valid strptime format is supported N(   t   fmt(   R/   R[   (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyt   __init__î   s    c         C  s&   t  t j t j | |  j ƒ d  Œ  ƒ S(   sM   s : string to be converted
           return value: a date2num float
        i   (   R   R-   t   timet   strptimeR[   (   R/   R;   (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyt   __call__ò   s    (   R4   R5   R6   R\   R_   (    (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyRZ   è   s   	c         C  sX   t  j |  ƒ r+ t j j |  ƒ } t | ƒ St g  |  D] } t j j | ƒ ^ q5 ƒ Sd S(   s�   
    Convert a date string to a datenum using
    :func:`dateutil.parser.parse`.  *d* can be a single string or a
    sequence of strings.
    N(   t   cbookt   is_string_liket   dateutilt   parsert   parseR   (   t   dR0   R;   (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyt   datestr2numù   s    
c         C  sC   t  j |  ƒ s t |  ƒ St j g  |  D] } t | ƒ ^ q& ƒ Sd S(   s×  
    *d* is either a :class:`datetime` instance or a sequence of datetimes.

    Return value is a floating point number (or sequence of floats)
    which gives the number of days (fraction part represents hours,
    minutes, seconds) since 0001-01-01 00:00:00 UTC, *plus* *one*.
    The addition of one here is a historical artifact.  Also, note
    that the Gregorian calendar is assumed; this is not universal
    practice.  For details, see the module docstring.
    N(   R`   t   iterableRL   t   npt   asarray(   Re   t   val(    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyR     s    
c         C  s)   t  j |  ƒ r! t j |  ƒ }  n  |  d S(   sG   Convert a Julian date (or sequence) to a matplotlib date (or sequence).g   €PD:A(   R`   Rg   Rh   Ri   (   t   j(    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyt
   julian2num  s    c         C  s)   t  j |  ƒ r! t j |  ƒ }  n  |  d S(   sG   Convert a matplotlib date (or sequence) to a Julian date (or sequence).g   €PD:A(   R`   Rg   Rh   Ri   (   t   n(    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyt
   num2julian  s    c         C  sX   | d k r t ƒ  } n  t j |  ƒ s4 t |  | ƒ Sg  |  D] } t | | ƒ ^ q; Sd S(   s  
    *x* is a float value which gives the number of days
    (fraction part represents hours, minutes, seconds) since
    0001-01-01 00:00:00 UTC *plus* *one*.
    The addition of one here is a historical artifact.  Also, note
    that the Gregorian calendar is assumed; this is not universal
    practice.  For details, see the module docstring.

    Return value is a :class:`datetime` instance in timezone *tz* (default to
    rcparams TZ value).

    If *x* is a sequence, a sequence of :class:`datetime` objects will
    be returned.
    N(   R@   R<   R`   Rg   RY   (   RU   RV   Rj   (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyR   %  s
    c         C  s¨   | j  | j t | j t } t |  ƒ } t | ƒ } t t j | | | ƒ ƒ } |  | | } | | k r… | | 8} | d 8} n  t | ƒ } t j	 | | | d ƒ S(   s¬   
    Return a date range as float Gregorian ordinals.  *dstart* and
    *dend* are :class:`datetime` instances.  *delta* is a
    :class:`datetime.timedelta` instance.
    i   (
   t   daysR'   RG   RM   RI   RL   RN   Rh   t   ceilt   linspace(   t   dstartt   dendRJ   t   stept   f1t   f2t   numt   dinterval_end(    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyR   <  s    
c           B  sP   e  Z d  Z e j d ƒ Z d d „ Z d d „ Z d „  Z	 d „  Z
 d „  Z RS(	   sY  
    Tick location is seconds since the epoch.  Use a :func:`strftime`
    format string.

    Python only supports :mod:`datetime` :func:`strftime` formatting
    for years greater than 1900.  Thanks to Andrew Dalke, Dalke
    Scientific Software who contributed the :func:`strftime` code
    below to include dates earlier than this year.
    s   ((^|[^%])(%%)*%s)c         C  s.   | d k r t ƒ  } n  | |  _ | |  _ d S(   sl   
        *fmt* is an :func:`strftime` format string; *tz* is the
         :class:`tzinfo` instance.
        N(   R@   R<   R[   RV   (   R/   R[   RV   (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyR\   f  s    	i    c         C  s@   | d k r t  d ƒ ‚ n  t | |  j ƒ } |  j | |  j ƒ S(   Ni    s¬   DateFormatter found a value of x=0, which is an illegal date.  This usually occurs because you have not informed the axis that it is plotting dates, eg with ax.xaxis_date()(   t
   ValueErrorR   RV   t   strftimeR[   (   R/   RU   t   posR0   (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyR_   p  s    c         C  s   | |  _  d  S(   N(   RV   (   R/   RV   (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyt
   set_tzinfoy  s    c         C  sO   g  } d } x< | j  | | ƒ } | d k r1 Pn  | j | ƒ | d } q | S(   Ni    iÿÿÿÿi   (   t   findt   append(   R/   t   textt   substrt   sitest   iRk   (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyt   _findall|  s    c         C  s”  |  j  j d | ƒ } | j d d ƒ } | j d k rL t j | j | ƒ ƒ S| j } d | } d | d | d } | | } | d | d	 d	 } | j ƒ  } t j | | f | d
 ƒ } |  j	 | t
 | ƒ ƒ } t j | | d	 f | d
 ƒ }	 |  j	 |	 t
 | d	 ƒ ƒ }
 g  } x* | D]" } | |
 k r | j | ƒ q q W| } d | j f } x( | D]  } | |  | | | d } qcWt j | ƒ S(   Ns   \1s   %sR;   il  iÐ  i   id   i�  i   i   s   %4di   (   t	   illegal_st   subt   replaceRQ   R`   t   unicode_safeRz   t	   timetupleR]   Rƒ   t   strR~   (   R/   R0   R[   RQ   RJ   t   offRˆ   t   s1t   sites1t   s2t   sites2R�   t   siteR;   t   syear(    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyRz   �  s.    	

!N(   R4   R5   R6   t   ret   compileR„   R@   R\   R_   R|   Rƒ   Rz   (    (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyR   Y  s   	
			c           B  s&   e  Z d  Z d d „ Z d d „ Z RS(   sa   
    Use with :class:`~matplotlib.ticker.IndexLocator` to cycle format
    strings by index.
    c         C  s7   | d k r t ƒ  } n  | |  _ | |  _ | |  _ d S(   sw   
        *t* is a sequence of dates (floating point days).  *fmt* is a
        :func:`strftime` format string.
        N(   R@   R<   t   tR[   RV   (   R/   R“   R[   RV   (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyR\   µ  s
    		i    c         C  si   t  t | ƒ ƒ } | t |  j ƒ k s3 | d k r7 d St |  j | |  j ƒ } t j | j |  j	 ƒ ƒ S(   s/   Return the label for time *x* at position *pos*i    t    (
   RN   t   roundt   lenR“   R   RV   R`   R‡   Rz   R[   (   R/   RU   R{   t   indR0   (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyR_   À  s
    !N(   R4   R5   R6   R@   R\   R_   (    (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyR   °  s   c           B  s)   e  Z d  Z d d d „ Z d d „ Z RS(   s"  
    This class attempts to figure out the best format to use.  This is
    most useful when used with the :class:`AutoDateLocator`.


    The AutoDateFormatter has a scale dictionary that maps the scale
    of the tick (the distance in days between one major tick) and a
    format string.  The default looks like this::

        self.scaled = {
           365.0  : '%Y',
           30.    : '%b %Y',
           1.0    : '%b %d %Y',
           1./24. : '%H:%M:%D',
           1. / (24. * 60.): '%H:%M:%S.%f',
           }


    The algorithm picks the key in the dictionary that is >= the
    current scale and uses that format string.  You can customize this
    dictionary by doing::


      formatter = AutoDateFormatter()
      formatter.scaled[1/(24.*60.)] = '%M:%S' # only show min and sec

    s   %Y-%m-%dc         C  sh   | |  _  | |  _ | |  _ t |  j | ƒ |  _ i d d 6d d 6d d 6d d d 6d	 d d 6|  _ d S(   s}   
        Autofmt the date labels.  The default format is the one to use
        if none of the times in scaled match
        s   %Yg     Ðv@s   %b %Yg      >@s   %b %d %Yg      ð?s   %H:%M:%Sg      8@s   %H:%M:%S.%fg      N@Ng     €–@(   t   _locatort   _tzt
   defaultfmtR   t
   _formattert   scaled(   R/   t   locatorRV   Rš   (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyR\   ó  s    			
i    c         C  sz   t  |  j j ƒ  ƒ } |  j } x4 t |  j ƒ D]# } | | k r. |  j | } Pq. q. Wt | |  j ƒ |  _ |  j | | ƒ S(   N(	   RA   R˜   t	   _get_unitRš   t   sortedRœ   R   R™   R›   (   R/   RU   R{   t   scaleR[   t   k(    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyR_     s    	N(   R4   R5   R6   R@   R\   R_   (    (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyR   Ë  s   t   rrulewrapperc           B  s#   e  Z d  „  Z d „  Z d „  Z RS(   c         K  s2   | j  ƒ  |  _ | |  j d <t |  j �  |  _ d  S(   Nt   freq(   t   copyt
   _constructR   t   _rrule(   R/   R£   t   kwargs(    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyR\     s    c         K  s&   |  j  j | ƒ t |  j  �  |  _ d  S(   N(   R¥   t   updateR   R¦   (   R/   R§   (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyt   set  s    c         C  s*   | |  j  k r |  j  | St |  j | ƒ S(   N(   t   __dict__t   getattrR¦   (   R/   t   name(    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyt   __getattr__  s    (   R4   R5   R\   R©   R­   (    (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyR¢     s   		c           B  se   e  Z i d  d 6d  d 6d  d 6Z d d „ Z d „  Z d „  Z d „  Z d „  Z d	 „  Z	 d
 „  Z
 RS(   i    t   byhourt   byminutet   bysecondc         C  s%   | d k r t ƒ  } n  | |  _ d S(   s5   
        *tz* is a :class:`tzinfo` instance.
        N(   R@   R<   RV   (   R/   RV   (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyR\   #  s    c         C  s   | |  _  d  S(   N(   RV   (   R/   RV   (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyR|   +  s    c         C  s7   |  j  j ƒ  \ } } t | |  j ƒ t | |  j ƒ f S(   N(   t   axist   get_data_intervalR   RV   (   R/   t   dmint   dmax(    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyt   datalim_to_dt.  s    c         C  s7   |  j  j ƒ  \ } } t | |  j ƒ t | |  j ƒ f S(   N(   R±   t   get_view_intervalR   RV   (   R/   t   vmint   vmax(    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyt   viewlim_to_dt2  s    c         C  s   d S(   sj   
        Return how many days a unit of the locator is; used for
        intelligent autoscaling.
        i   (    (   R/   (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyRž   6  s    c         C  s   d S(   s;   
        Return the number of units for each tick.
        i   (    (   R/   (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyt   _get_interval=  s    c         C  s_   |  j  ƒ  } |  j ƒ  } t | | ƒ d k  rU | d | | 8} | d | | 7} n  | | f S(   s‘   
        Given the proposed upper and lower extent, adjust the range
        if it is too close to being singular (i.e. a range of ~0).

        g�íµ ÷Æ°>i   (   Rž   Rº   t   abs(   R/   R·   R¸   t   unitt   interval(    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyt   nonsingularC  s    N(   R4   R5   t   hms0dR@   R\   R|   Rµ   R¹   Rž   Rº   R¾   (    (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyR      s   					c           B  sG   e  Z d d  „ Z d „  Z d „  Z e d „  ƒ Z d „  Z d „  Z	 RS(   c         C  s   t  j |  | ƒ | |  _ d  S(   N(   R   R\   t   rule(   R/   t   oRV   (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyR\   T  s    c   
      C  s”  y |  j  ƒ  \ } } Wn t k
 r* g  SX| | k rG | | } } n  t | | ƒ } y | | } Wn t k
 rƒ t d ƒ } n Xy | | } Wn t k
 r± t d ƒ } n X|  j j d | d | d |  j d ƒ t | | f ƒ \ } } | | |  j ƒ  |  j	 ƒ  } | |  j d k rGt
 d | | | |  j d f ƒ ‚ n  |  j j | | t ƒ }	 t |	 ƒ d	 k r�t | | g ƒ S|  j t |	 ƒ ƒ S(
   Ng      ð?g)ÿÿÿíÜKAt   dtstartt   untilt   counti   i   s]   RRuleLocator estimated to generate %d ticks from %s to %s: exceeds Locator.MAXTICKS * 2 (%d) i    (   R¹   Ry   R   RY   RÀ   R©   t   MAXTICKSR   Rž   Rº   t   RuntimeErrort   betweent   TrueR–   t   raise_if_exceeds(
   R/   R³   R´   RJ   t   startt   stopt   nmaxt   nmint   estimatet   dates(    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyR_   X  s6    &	c         C  s   |  j  j j } |  j | ƒ S(   sj   
        Return how many days a unit of the locator is; used for
        intelligent autoscaling.
        (   RÀ   R¦   t   _freqt   get_unit_generic(   R/   R£   (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyRž   ƒ  s    c         C  s„   |  t  k r d S|  t k r  d S|  t k r0 d S|  t k r@ d S|  t k rT d d S|  t k rh d d
 S|  t k r| d d Sd	 Sd  S(   Ng     Ðv@g      >@g      @g      ð?g      8@i   i<   i  iÿÿÿÿi   i€Q (   R
   R   R   R   R   R   R   (   R£   (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyRÑ   ‹  s    c         C  s   |  j  j j S(   N(   RÀ   R¦   t	   _interval(   R/   (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyRº   Ÿ  s    c         C  s4  |  j  ƒ  \ } } | | k r. | | } } n  t | | ƒ } y | | } Wn t k
 rj t d ƒ } n Xy | | } Wn t k
 r˜ t d ƒ } n X|  j j d | d | ƒ |  j  ƒ  \ } } |  j j | t ƒ } | sè | } n  |  j j | t ƒ } | s| } n  t	 | ƒ } t	 | ƒ } |  j
 | | ƒ S(   s@   
        Set the view limits to include the data range.
        g      ð?g)ÿÿÿíÜKARÂ   RÃ   (   Rµ   R   Ry   RY   RÀ   R©   t   beforeRÈ   t   afterR   R¾   (   R/   R³   R´   RJ   RÊ   RË   R·   R¸   (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyt	   autoscale¢  s.    		N(
   R4   R5   R@   R\   R_   Rž   t   staticmethodRÑ   Rº   RÕ   (    (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyR   Q  s   	+		c           B  sb   e  Z d  Z d
 d d
 e d „ Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d „  Z d	 „  Z RS(   s}   
    On autoscale, this class picks the best
    :class:`DateLocator` to set the view limits and the tick
    locations.
    i   c         C  s7  t  j |  | ƒ t ƒ  |  _ t |  _ t t t t t	 t
 t g |  _ | |  _ i d t 6d t 6d t 6d t 6d t	 6d t
 6d t 6|  _ | d' k	 rè y |  j j | ƒ Wqè t k
 rä t t |  j | g t |  j ƒ ƒ ƒ |  _ qè Xn  | |  _ i d d d d d d	 d
 d d d d d d d d d d g t 6d d d d d g t 6d d d d d d g t 6d d d d d d g t 6d d d d d g t	 6d d d d d g t
 6d d d d d	 d d d d d d d d d d d d d  d! g t 6|  _ d' t d d" ƒ t d d# ƒ t d$ d% ƒ t d$ d& ƒ t d$ d& ƒ d' g |  _ d' S((   sš  
        *minticks* is the minimum number of ticks desired, which is used to
        select the type of ticking (yearly, monthly, etc.).

        *maxticks* is the maximum number of ticks desired, which controls
        any interval between ticks (ticking every other, every 3, etc.).
        For really fine-grained control, this can be a dictionary mapping
        individual rrule frequency constants (YEARLY, MONTHLY, etc.)
        to their own maximum number of ticks.  This can be used to keep
        the number of ticks appropriate to the format chosen in
        :class:`AutoDateFormatter`. Any frequency not specified in this
        dictionary is given a default value.

        *tz* is a :class:`tzinfo` instance.

        *interval_multiples* is a boolean that indicates whether ticks
        should be chosen to be multiple of the interval. This will lock
        ticks to 'nicer' locations. For example, this will force the
        ticks to be at hours 0,6,12,18 when hourly ticking is done at
        6 hour intervals.

        The AutoDateLocator has an interval dictionary that maps the
        frequency of the tick (a constant from dateutil.rrule) and a
        multiple allowed for that ticking.  The default looks like this::

          self.intervald = {
            YEARLY  : [1, 2, 4, 5, 10, 20, 40, 50, 100, 200, 400, 500,
                      1000, 2000, 4000, 5000, 10000],
            MONTHLY : [1, 2, 3, 4, 6],
            DAILY   : [1, 2, 3, 7, 14],
            HOURLY  : [1, 2, 3, 4, 6, 12],
            MINUTELY: [1, 5, 10, 15, 30],
            SECONDLY: [1, 5, 10, 15, 30],
            MICROSECONDLY: [1, 2, 5, 10, 20, 50, 100, 200, 500, 1000, 2000,
                           5000, 10000, 20000, 50000, 100000, 200000, 500000,
                           1000000],
            }

        The interval is used to specify multiples that are appropriate for
        the frequency of ticking. For instance, every 7 days is sensible
        for daily ticks, but for minutes/seconds, 15 or 30 make sense.
        You can customize this dictionary by doing::

          locator = AutoDateLocator()
          locator.intervald[HOURLY] = [3] # only show every 3 hours
        i   i   i   i   i   i   i   i
   i   i(   i2   id   iÈ   i�  iô  iè  iÐ  i   iˆ  i'  i   i   i   i   i   i   i   i N  iPÃ  i † i@ i ¡ i@B i   i    i    i   i<   N(   R   R\   R   R˜   R
   RÐ   R   R   R   R   R   R&   t   _freqst   mintickst   maxticksR@   R¨   t	   TypeErrort   dictR   R–   t   interval_multiplest	   intervaldt   ranget	   _byranges(   R/   RV   RØ   RÙ   RÜ   (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyR\   Ï  s8    0		&	$!'c         C  s   |  j  ƒ  |  j ƒ  S(   s!   Return the locations of the ticks(   t   refreshR˜   (   R/   (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyR_      s    
c         C  s-   | | k r# | d } | d } n  | | f S(   Nim  i   iÚ  iÚ  (    (   R/   R·   R¸   (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyR¾   %  s    
c         C  s$   t  j |  | ƒ |  j j | ƒ d  S(   N(   R   t   set_axisR˜   (   R/   R±   (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyRá   -  s    c         C  s+   |  j  ƒ  \ } } |  j | | ƒ |  _ d S(   s5   Refresh internal information based on current limits.N(   R¹   t   get_locatorR˜   (   R/   R³   R´   (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyRà   1  s    c         C  s.   |  j  t g k r d t St j |  j  ƒ Sd  S(   Ng      ð?(   RÐ   R&   RI   R   RÑ   (   R/   (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyRž   6  s    c         C  s4   |  j  ƒ  \ } } |  j | | ƒ |  _ |  j j ƒ  S(   s,   Try to choose the view limits intelligently.(   Rµ   Râ   R˜   RÕ   (   R/   R³   R´   (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyRÕ   <  s    c         C  s™  t  | | ƒ } | j d } | d | j } | d | j } | d | j } | d | j } | d | j }	 |	 d | j }
 | | | | | |	 |
 g } t g d t	 g } d d d d	 d	 d	 d g } xü t t |  j | ƒ ƒ D]Ö \ } \ } } | |  j k  rd | | <qå n  xJ |  j | D]% } | | |  j | d k r$Pq$q$Wt j d
 j | ƒ ƒ | |  _ |  j | r©|  j r©|  j | d d | … | | <d } n |  j | | | <Pqå Wt d ƒ ‚ | | rD| \ } } } } } } } t |  j d | d | d | d | d | d | d | d | ƒ} t | |  j ƒ } n t | d |  j ƒ} | j |  j ƒ | j |  j j ƒ  Œ  | j  |  j j! ƒ  Œ  | S(   s*   Pick the best locator based on a distance.g      ð?g      (@g      ?@g      8@g      N@g    €„.Ai   i   i    s¾   AutoDateLocator was unable to pick an appropriate interval for this date range. It may be necessary to add an interval value to the AutoDateLocator's intervald dictionary. Defaulting to {0}.Ns=   No sensible date limit could be found in the AutoDateLocator.R½   RÂ   RÃ   t   bymontht
   bymonthdayR®   R¯   R°   RV   ("   R   t   yearst   monthsRo   R)   R(   R'   RM   RÈ   t   FalseR@   t	   enumerateR   R×   RØ   RÝ   RÙ   t   warningst   warnt   formatRÐ   Rß   RÜ   Ry   R¢   R   RV   R%   Rá   R±   t   set_view_intervalR¶   t   set_data_intervalR²   (   R/   R³   R´   RJ   t   numYearst	   numMonthst   numDayst   numHourst
   numMinutest
   numSecondst   numMicrosecondst   numst   use_rrule_locatort   byrangesR‚   R£   Rw   R½   t   _Rã   Rä   R®   R¯   R°   R   R�   (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyRâ   B  sR    +

		
	N(   R4   R5   R6   R@   Rç   R\   R_   R¾   Rá   Rà   Rž   RÕ   Râ   (    (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyR   É  s   	P						c           B  s5   e  Z d  Z d d d d d „ Z d „  Z d „  Z RS(   sõ   
    Make ticks on a given day of each year that is a multiple of base.

    Examples::

      # Tick every year on Jan 1st
      locator = YearLocator()

      # Tick every 5 years on July 4th
      locator = YearLocator(5, month=7, day=4)
    i   c         C  sY   t  j |  | ƒ t j | ƒ |  _ i | d 6| d 6d d 6d d 6d d 6| d 6|  _ d S(	   sh   
        Mark years that are multiple of base on a given month and day
        (default jan 1).
        RR   RS   i    R>   RD   RF   R=   N(   R   R\   t   tickert   BaseRK   t   replaced(   R/   RK   RR   RS   RV   (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyR\   £  s    
c         C  s¹   |  j  ƒ  \ } } |  j j | j ƒ } |  j j | j ƒ } | j d | |  j � g } x[ | d } | j | k r} t | ƒ S| j |  j j ƒ  } | j	 | j d | |  j � ƒ qZ d  S(   NRQ   iÿÿÿÿ(
   R¹   RK   t   leRQ   t   geR†   Rû   R   t   get_baseR~   (   R/   R³   R´   t   ymint   ymaxt   ticksR0   RQ   (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyR_   ²  s    

c         C  s”   |  j  ƒ  \ } } |  j j | j ƒ } |  j j | j ƒ } | j d | |  j � } | j d | |  j � } t | ƒ } t | ƒ } |  j | | ƒ S(   s@   
        Set the view limits to include the data range.
        RQ   (	   Rµ   RK   Rü   RQ   Rý   R†   Rû   R   R¾   (   R/   R³   R´   Rÿ   R   R·   R¸   (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyRÕ   ¿  s    N(   R4   R5   R6   R@   R\   R_   RÕ   (    (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyR   —  s   	c           B  s#   e  Z d  Z d d d d d „ Z RS(   sD   
    Make ticks on occurances of each month month, eg 1, 3, 12.
    i   c      	   C  sY   | d k r t d d ƒ } n  t t d | d | d | |  j �} t j |  | | ƒ d S(   s  
        Mark every month in *bymonth*; *bymonth* can be an int or
        sequence.  Default is ``range(1,13)``, i.e. every month.

        *interval* is the interval between each iteration.  For
        example, if ``interval=2``, mark every second occurance.
        i   i   Rã   Rä   R½   N(   R@   RÞ   R¢   R   R¿   R   R\   (   R/   Rã   Rä   R½   RV   RÁ   (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyR\   Ó  s
    N(   R4   R5   R6   R@   R\   (    (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyR   Ï  s   c           B  s    e  Z d  Z d d d d „ Z RS(   s3   
    Make ticks on occurances of each weekday.
    i   c         C  s5   t  t d | d | |  j �} t j |  | | ƒ d S(   s]  
        Mark every weekday in *byweekday*; *byweekday* can be a number or
        sequence.

        Elements of *byweekday* must be one of MO, TU, WE, TH, FR, SA,
        SU, the constants from :mod:`dateutils.rrule`.

        *interval* specifies the number of weeks to skip.  For example,
        ``interval=2`` plots every second week.
        t	   byweekdayR½   N(   R¢   R   R¿   R   R\   (   R/   R  R½   RV   RÁ   (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyR\   ç  s    N(   R4   R5   R6   R@   R\   (    (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyR    â  s   c           B  s    e  Z d  Z d d d d „ Z RS(   sY   
    Make ticks on occurances of each day of the month.  For example,
    1, 15, 30.
    i   c         C  sS   | d k r t d d ƒ } n  t t d | d | |  j �} t j |  | | ƒ d S(   s°   
        Mark every day in *bymonthday*; *bymonthday* can be an int or
        sequence.

        Default is to tick every day of the month: ``bymonthday=range(1,32)``
        i   i    Rä   R½   N(   R@   RÞ   R¢   R   R¿   R   R\   (   R/   Rä   R½   RV   RÁ   (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyR\   ü  s
    N(   R4   R5   R6   R@   R\   (    (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyR!   ÷  s   c           B  s    e  Z d  Z d d d d „ Z RS(   s0   
    Make ticks on occurances of each hour.
    i   c      
   C  sV   | d k r t d ƒ } n  t t d | d | d d d d ƒ} t j |  | | ƒ d S(   s  
        Mark every hour in *byhour*; *byhour* can be an int or sequence.
        Default is to tick every hour: ``byhour=range(24)``

        *interval* is the interval between each iteration.  For
        example, if ``interval=2``, mark every second occurrence.
        i   R®   R½   R¯   i    R°   N(   R@   RÞ   R¢   R   R   R\   (   R/   R®   R½   RV   RÀ   (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyR\     s
    N(   R4   R5   R6   R@   R\   (    (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyR"   
  s   c           B  s    e  Z d  Z d d d d „ Z RS(   s2   
    Make ticks on occurances of each minute.
    i   c         C  sP   | d k r t d ƒ } n  t t d | d | d d ƒ} t j |  | | ƒ d S(   s  
        Mark every minute in *byminute*; *byminute* can be an int or
        sequence.  Default is to tick every minute: ``byminute=range(60)``

        *interval* is the interval between each iteration.  For
        example, if ``interval=2``, mark every second occurrence.
        i<   R¯   R½   R°   i    N(   R@   RÞ   R¢   R   R   R\   (   R/   R¯   R½   RV   RÀ   (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyR\   !  s
    	N(   R4   R5   R6   R@   R\   (    (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyR#     s   c           B  s    e  Z d  Z d d d d „ Z RS(   s2   
    Make ticks on occurances of each second.
    i   c         C  sJ   | d k r t d ƒ } n  t t d | d | ƒ} t j |  | | ƒ d S(   s  
        Mark every second in *bysecond*; *bysecond* can be an int or
        sequence.  Default is to tick every second: ``bysecond = range(60)``

        *interval* is the interval between each iteration.  For
        example, if ``interval=2``, mark every second occurrence.

        i<   R°   R½   N(   R@   RÞ   R¢   R   R   R\   (   R/   R°   R½   RV   RÀ   (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyR\   4  s    	N(   R4   R5   R6   R@   R\   (    (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyR$   0  s   c           B  sS   e  Z d  Z d d	 d „ Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 RS(
   s8   
    Make ticks on occurances of each microsecond.

    i   c         C  s(   | |  _  t j | ƒ |  _ | |  _ d S(   s�   
        *interval* is the interval between each iteration.  For
        example, if ``interval=2``, mark every second microsecond.

        N(   RÒ   Rù   t   MultipleLocatort   _wrapped_locatorRV   (   R/   R½   RV   (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyR\   H  s    	c         C  s    |  j  j | ƒ t j |  | ƒ S(   N(   R  Rá   R   (   R/   R±   (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyRá   R  s    c         C  s&   |  j  j | | ƒ t j |  | | ƒ S(   N(   R  Rì   R   (   R/   R·   R¸   (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyRì   V  s    c         C  s&   |  j  j | | ƒ t j |  | | ƒ S(   N(   R  Rí   R   (   R/   R·   R¸   (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyRí   Z  s    c         O  s_   |  j  j ƒ  \ } } | t 9} | t 9} |  j j | | ƒ } g  | D] } | t ^ qE } | S(   N(   R±   R¶   RI   R  t   tick_values(   R/   t   argsR§   R·   R¸   R  t   tick(    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyR_   ^  s    

c         C  s   d t  S(   sj   
        Return how many days a unit of the locator is; used for
        intelligent autoscaling.
        g      ð?(   RI   (   R/   (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyRž   f  s    c         C  s   |  j  S(   s;   
        Return the number of units for each tick.
        (   RÒ   (   R/   (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyRº   m  s    N(   R4   R5   R6   R@   R\   Rá   Rì   Rí   R_   Rž   Rº   (    (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyR%   C  s   
					i   c         C  sE   | |  } t  | j t | j d | j ƒ } | | k  sA t ‚ d S(   sF   Assert that datetimes *d1* and *d2* are within *epsilon* microseconds.g    €„.AN(   R»   Ro   RI   R'   RM   t   AssertionError(   t   d1t   d2t   epsilonRJ   t   mus(    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyt   _close_to_dtt  s    
c         C  s*   t  | |  t ƒ } | | k  s& t ‚ d S(   sY   
    Assert that float ordinals *o1* and *o2* are within *epsilon*
    microseconds.
    N(   R»   RI   R  (   t   o1t   o2R  RJ   (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyt   _close_to_num|  s    c         C  s   d } d t  j |  ƒ | S(   se   
    Convert an epoch or sequence of epochs to the new date format,
    that is days since 0001.
    g      8@g      ¬@i;ù
 g     õ@(   Rh   Ri   (   t   et   spd(    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyR   …  s    c         C  s   d } t  j |  ƒ d | S(   sM   
    Convert days since 0001 to epoch.  *d* can be a number or sequence.
    g      8@g      ¬@i;ù
 g     õ@(   Rh   Ri   (   Re   R  (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyR   Ž  s    c         C  sb   t  } t j |  ƒ s' t } |  g }  n  t g  |  D] } | j ƒ  ^ q1 ƒ } | rZ | d S| Sd S(   si   
    Convert mx :class:`datetime` instance (or sequence of mx
    instances) to the new date format.
    i    N(   Rç   R`   Rg   RÈ   R   R  (   t   mxdatest   scalart   mt   ret(    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyR   –  s    %c         C  s¶  |  d k r d d }  n  |  d d } |  d } |  } |  d } |  d } |  d } | | k r† t  t | | ƒ d	 | ƒ}	 d
 }
 n| | k rª t d	 | ƒ }	 d }
 nð | | k rÎ t d	 | ƒ }	 d }
 nÌ | | k rt d t t j | | ƒ ƒ d	 | ƒ }	 d }
 n� | | k rHt d t t j | | ƒ ƒ d	 | ƒ }	 d }
 nR | | k r…t d t t j | | ƒ ƒ d	 | ƒ }	 d }
 n t d	 | ƒ }	 d }
 t	 |
 d	 | ƒ} |	 | f S(   sŒ   
    Create a date locator with *numticks* (approx) and a date formatter
    for *span* in days.  Return value is (locator, formatter).
    i    i   g      8@i   i<   g      @g      ?@g     Ðv@RV   s   %Ys   %b %Ys	   %a, %b %dR½   s   %b %ds   %H:%M
%b %ds   %H:%M:%S(
   R   RN   R   R    R!   t   mathRp   R"   R#   R   (   t   spanRV   t   numticksR(   R)   Ro   R*   Ræ   Rå   R�   R[   t	   formatter(    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyt   date_ticker_factory¦  s>    



			(	(			c         C  s   t  |  ƒ t S(   s   Return seconds as days.(   RA   t   SEC_PER_DAY(   R;   (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyR'   Ñ  s    c         C  s   t  |  ƒ t S(   s   Return minutes as days.(   RA   RE   (   R  (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyR(   Ö  s    c         C  s   |  d S(   s   Return hours as days.g      8@(    (   t   h(    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyR)   Û  s    c         C  s   |  d S(   s   Return weeks as days.g      @(    (   t   w(    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyR*   à  s    t   DateConverterc           B  s;   e  Z d  Z e d „  ƒ Z e d „  ƒ Z e d „  ƒ Z RS(   sÙ   
    Converter for datetime.date and datetime.datetime data,
    or for date/time data represented as it would be converted
    by :func:`date2num`.

    The 'unit' tag for such data is None or a tzinfo instance.
    c      
   C  sy   |  } t  d | ƒ } t | d | ƒ} t j d d d ƒ } t j d d d ƒ } t j d | d | d d d	 | | f ƒ S(
   s°   
        Return the :class:`~matplotlib.units.AxisInfo` for *unit*.

        *unit* is a tzinfo instance or None.
        The *axis* argument is required but not used.
        RV   iÐ  i   iÚ  t   majloct   majfmtt   labelR”   t   default_limits(   R   R   R-   t   datet   unitst   AxisInfo(   R¼   R±   RV   R   R!  t   datemint   datemax(    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyt   axisinfoî  s    c         C  s    t  j j |  ƒ r |  St |  ƒ S(   s­   
        If *value* is not already a number or sequence of numbers,
        convert it with :func:`date2num`.

        The *unit* and *axis* arguments are not used.
        (   R%  t   ConversionInterfacet
   is_numlikeR   (   t   valueR¼   R±   (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyt   convert   s    c         C  sK   y |  d }  Wn t  t f k
 r' n Xy |  j SWn t k
 rF n Xd S(   sB   Return the tzinfo instance of *x* or of its first element, or Nonei    N(   RÚ   t
   IndexErrorR=   t   AttributeErrorR@   (   RU   R±   (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyt   default_units  s    (   R4   R5   R6   RÖ   R)  R-  R0  (    (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyR  å  s   ()   s   date2nums   num2dates   dranges	   epoch2nums	   num2epochs   mx2nums   DateFormatters   IndexDateFormatters   AutoDateFormatters   DateLocators   RRuleLocators   AutoDateLocators   YearLocators   MonthLocators   WeekdayLocators
   DayLocators   HourLocators   MinuteLocators   SecondLocators   MicrosecondLocators   rrules   MOs   TUs   WEs   THs   FRs   SAs   SUs   YEARLYs   MONTHLYs   WEEKLYs   DAILYs   HOURLYs   MINUTELYs   SECONDLYs   MICROSECONDLYs   relativedeltas   secondss   minutess   hourss   weeks(    (    (f   R6   t
   __future__R    R‘   R]   R  R-   t	   itertoolsR   Ré   t   dateutil.rruleR   R   R   R   R   R   R   R	   R
   R   R   R   R   R   R   t   dateutil.relativedeltaR   t   dateutil.parserRb   t   numpyRh   R8   t   matplotlib.unitsR%  t   matplotlib.cbookR`   t   matplotlib.tickerRù   t   __all__R=   R+   R,   R<   R&   RC   RE   RG   RI   t   SEC_PER_MINt   SEC_PER_HOURR  t   SEC_PER_WEEKt   MONDAYt   TUESDAYt	   WEDNESDAYt   THURSDAYt   FRIDAYt   SATURDAYt   SUNDAYt   WEEKDAYSRL   R@   RY   RZ   Rf   R   Rl   Rn   R   R   t	   FormatterR   R   R   R¢   t   LocatorR   R   R   R   R   R    R!   R"   R#   R$   R%   R  R  R   R   R   R  R'   R(   R)   R*   R*  R  t   registryR$  (    (    (    sJ   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/dates.pyt   <module>l   sš   d          		





0						WD1xÎ81					+				6