ó
@™xTc           @   s¤   d  d l  m Z d  d l m Z d  d l m Z d  d l Z e j j	 d ƒ Z
 d  d l Td  d l m Z d  d l m Z d	 „  Z d
 „  Z e d k r  e ƒ  n  d S(   iÿÿÿÿ(   t   division(   t   random_structure(   t   space_group_infoNt   cctbx_asymmetric_map_ext(   t   *(   t   flex(   t   maptbxc         C   sa  t  |  ƒ } d GHd d } t j d | d d	 d
 t d | d d ƒ } | j ƒ  d } | j d | ƒ j ƒ  } t j } | j	 d | ƒ } | j
 ƒ  j ƒ  j ƒ  } d G| GHt | j ƒ  j ƒ  | j
 ƒ  ƒ }	 |	 j | j ƒ  ƒ }
 |	 j ƒ  } d G| j ƒ  j ƒ  GH|	 j ƒ  } | j ƒ  } d G| j ƒ  Gd G| j ƒ  Gd G| j ƒ  Gd G| j ƒ  GHt j |
 | j ƒ  ƒ } t j | ƒ t j t j | j ƒ  ƒ ƒ } d G| GH| d k  s°t ‚ | j ƒ  } | j | ƒ | j ƒ  d } t | j ƒ  j ƒ  | | ƒ } | j | j ƒ  ƒ } t j | d | j ƒ  ƒ } t j | ƒ t j t j | j ƒ  ƒ ƒ } d G| GH| d k  sot ‚ |	 j ƒ  } | j ƒ  j ƒ  | k s™t ‚ d } d } d } xŠ t | j
 ƒ  | ƒ D]s \ } } t | | ƒ } d t | ƒ t | ƒ } | | | k st ‚ | d k rÁ| | | } | d } qÁqÁW| | } d G| GH| d k  s]t ‚ d  S(   Ns   
==t   Ct   Nt   Ot   Hi   R   t   volume_per_atomg      9@t   general_positions_onlyt   elementst   min_distanceg      ð?g       @t   d_mint   symmetry_flagss   FFT grid_size = s   whole cell map size: s   Asu map size: t    s   R1: gñhãˆµøä>g      à?s
   R1 again: g�íµ ÷Æ°>i    g        i   s   mean rel err: (   R   R   R	   R
   (   R   R   t   xray_structuret   Falset   show_summaryt   structure_factorst   f_calcR   t   use_space_group_symmetryt   fft_mapt   real_mapt   accessort   focust   asymmetric_mapt   space_groupt   typet   indicest   map_for_fftt   datat   origint   lastt   allR   t   abst   sumt   AssertionErrort   shift_origint   reshapet	   deep_copyt   symmetry_expanded_mapt   zip(   t   symbolt   groupR   t   strucR   t   fcR   t   fftmapt	   grid_sizet   amapt   afct   afftmapt   adatat   acct   dft   r1t   adata2t   amap2t   afc2t   df2t   r12t   p1_mapt   rel_tolt   nt   mean_rel_dift   m1t   m2t   dift   av(    (    sM   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/tst_asymmetric_map.pyt	   run_group
   sh    
		
		!*+	+	"
	c          C   s(   x! t  d d ƒ D] }  t |  ƒ q Wd  S(   Ni   iç   (   t   xrangeRG   (   t   i(    (    sM   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/tst_asymmetric_map.pyt   runJ   s    t   __main__(   t
   __future__R    t   cctbx.developmentR   t   cctbx.sgtbxR   t   boost.pythont   boostt   pythont
   import_extt   extR   t   cctbx.array_familyR   t   cctbxR   RG   RJ   t   __name__(    (    (    sM   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/tst_asymmetric_map.pyt   <module>   s   
	@	