ó
6™xTc           @   so   d  d l  m Z d  d l m Z d  d l m Z d  d l m Z d  d l Z d „  Z e d k rk e ƒ  n  d S(   iÿÿÿÿ(   t   division(   t   sgtbx(   t   uctbx(   t   adptbxNc       	   C   s7  t  j d ƒ }  t  j d |  d t ƒ } | j ƒ  } d } d } |  j | ƒ } | j d | ƒ } t | ƒ | k sx t ‚ | j	 d | ƒ } t | ƒ d k s¢ t ‚ t
 j | | ƒ } t
 j | ƒ } g  | D] } d t j d | | ^ qÊ }	 t |	 ƒ d k st ‚ t
 j | ƒ }
 d t j d d | |
 } t | ƒ d d d k sSt ‚ | j d |	 ƒ } t | ƒ | k s}t ‚ | j d | ƒ } t | ƒ | | d d k s³t ‚ t j d  ƒ } t  j d ƒ j ƒ  }  t  j d | d |  d d! d" d f d d ƒ } t | j ƒ  ƒ d k s"t ‚ | j ƒ  } d GHd  S(#   Ns   P 3*t   space_groupt   reciprocal_spacei   i   i   g�íµ ÷ÆÐ>g·_>Y1\Ý>g�íµ ÷ÆÀ>g        t
   all_paramst   independent_paramsi   iþÿÿÿt   all_gradientst   all_curvaturesi   i   iZ   ix   s   P 6t	   unit_cellt   original_siteg      @i    t   min_distance_sym_equivg      à?t   OK(   i   i   i   (   g�íµ ÷ÆÐ>g�íµ ÷ÆÐ>g·_>Y1\Ý>g�íµ ÷ÆÀ>g        g        i   (   i   i   i   iZ   iZ   ix   gUUUUUUÕ?gUUUUUUå?(   R   R   t   tensor_rank_2_constraintst   Truet   n_independent_paramst   average_u_starR   t   lent   AssertionErrorR   R   t   debye_waller_factor_u_start0   debye_waller_factor_u_star_gradient_coefficientst   matht   pit1   debye_waller_factor_u_star_curvature_coefficientst   independent_gradientst   independent_curvaturesR   R
   t   space_group_infot   groupt   site_symmetryt   matricest   adp_constraints(   R   R   t   n_indept   ht   u_start   u_indept   dwft   gct   cR   t   ccR	   t   g_indept   c_indepR
   R   (    (    sU   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/examples/adp_symmetry_constraints.pyt   run   sF    		, 				$		t   __main__(	   t
   __future__R    t   cctbxR   R   R   R   R*   t   __name__(    (    (    sU   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/examples/adp_symmetry_constraints.pyt   <module>   s   	R