ó
7™xTc           @   sp   d  d l  m Z d  d l m Z d  d l Z d „  Z d „  Z d d d „ Z d „  Z	 e
 d k rl e	 ƒ  n  d S(	   iÿÿÿÿ(   t   division(   t   sgtbxNc         C   s   d |  S(   Ns
   [%d,%d,%d](    (   t   ev(    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/examples/all_axes.pyt   str_ev   s    c         C   s#  t  j |  j ƒ  ƒ } t  j |  ƒ } t | j ƒ  j ƒ  ƒ } t | j ƒ  j ƒ  ƒ } | j ƒ  d k rj d S| j ƒ  d k rŸ t | j ƒ  ƒ d d d | f f St	 | j ƒ  ƒ d k rí t | j ƒ  ƒ t
 | j ƒ  ƒ d | f d | f f St | j ƒ  ƒ t
 | j ƒ  ƒ d | f d | f f S(   Ni   t   1t   -iÿÿÿÿs   (%s)i   (   R   R   R   R   (   R   t   rot_mx_infot   rt   translation_part_infot   strt   intrinsic_partt   mod_positivet   origin_shiftt   typet   absR   R   (   t   st   r_infot   t_infot   t_intrinsict   t_shift(    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/examples/all_axes.pyt   rt_mx_analysis   s"    #

c         C   s  |  d  k s | d  k s t ‚ d } |  d  k	 rE t j d |  ƒ } n  | j ƒ  Hd GHi  } xð | j ƒ  D]â } | j ƒ  } | j ƒ  } d d d g } x² t | | d ƒ D]œ | d <x� t | | d ƒ D]y | d <xl t | | d ƒ D]V | d <| j	 t j
 | d ƒ ƒ j | j ƒ  ƒ } t j | | ƒ }	 d | t |	 ƒ <qè WqÉ Wqª Wqh W| j ƒ  }
 |
 j ƒ  x |
 D] } | GHqkWHd  S(   Ni   t   symbols;   Rotation type, Axis direction, Intrinsic part, Origin shifti    i   (   t   Nonet   AssertionErrorR   t   space_group_infot   show_summaryt   groupR   t   tt   xranget   plust   tr_vect   new_denominatort   dent   rt_mxR   t   keyst   sort(   t   space_group_symbolR   t   shift_ranget	   axes_dictR   R   R   t   shiftt   tst   sst	   axes_listt   a(    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/examples/all_axes.pyt   list_all_axes'   s.    
* 
	c          C   sc   t  t j ƒ d k r= xG t d ƒ D] }  t |  d ƒ q" Wn" x t j d D] } t | ƒ qK Wd  S(   Ni   iæ   (   t   lent   syst   argvR   R,   (   t   iR   (    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/examples/all_axes.pyt   runA   s
    t   __main__(   t
   __future__R    t   cctbxR   R.   R   R   R   R,   R1   t   __name__(    (    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/examples/all_axes.pyt   <module>   s   			