ó
9™xTc           @   si   d  Z  d d l m Z d d l m Z d d l m Z d d l m Z d „  Z e	 d k re e ƒ  n  d S(	   s9  
This example shows that a change of hand ("flipping coordinates") involves
changing the space group if the space group is enantimorphic.
Note that the interatomic distances do not change if the space group
symmetry is transformed correctly, but do change if the original space
group symmetry is simply retained.
iÿÿÿÿ(   t   division(   t   xray(   t   crystal(   t   flexc          C   sb  t  GHt j d d  d d ƒ }  d } t j ƒ  } xJ t d! d" d# g ƒ D]3 \ } } | j t j d d | d d | ƒ ƒ qE Wt j	 d |  d | ƒ } d GHd GHd GH| j
 ƒ  j ƒ  d GH| j d | ƒ HHd GHd GHd GH| j ƒ  } | j
 ƒ  j ƒ  d GH| j d | ƒ Hd GHd GHd GHt j	 d |  d | j ƒ  ƒ } | j
 ƒ  j ƒ  d GH| j d | ƒ Hd  S($   Nt	   unit_celli   i   iZ   ix   t   space_group_symbols   P 31g      @g„O¯”eè?gf÷äa¡Öâ?gQÚ|a2Ù?gâX·Ñ Ò?g&äƒžÍªï?g[±¿ìž<î?gWì/»'ß?g#Ûù~j¼ì?grŠŽäòÞ?t   labels   Se%di   t   sitet   crystal_symmetryt
   scattererss   ==================s   Original structures   Interatomic distances:t   distance_cutoffs5   =====================================================s5   Other hand with sites flipped and space group changeds"   ==================================s"   Other hand with sites flipped only(   i   i   i   iZ   iZ   ix   (   g„O¯”eè?gf÷äa¡Öâ?gQÚ|a2Ù?(   gâX·Ñ Ò?g&äƒžÍªï?g[±¿ìž<î?(   gWì/»'ß?g#Ûù~j¼ì?grŠŽäòÞ?(   t   __doc__R   t   symmetryR   t   xray_scatterert	   enumeratet   appendR   t	   scatterert	   structuret   show_summaryt   show_scattererst   show_distancest   change_handR	   (   R   R
   R	   t   iR   t   given_structuret
   other_handt   other_sites_orig_symmetry(    (    sL   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/examples/change_hand_p31.pyt   run   sP    						t   __main__N(
   R   t
   __future__R    t   cctbxR   R   t   cctbx.array_familyR   R   t   __name__(    (    (    sL   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/examples/change_hand_p31.pyt   <module>   s   	*