ó
îxTc           @   sł   d  d l  m Z d  d l m Z d  d l m Z d  d l m Z d  d l m 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 rŻ e   n  d S(   i˙˙˙˙(   t   division(   t   maptbx(   t   random_structure(   t   miller(   t   sgtbx(   t   flex(   t   approx_equal(   t   format_cpu_times(   t	   ab_initioc       
   C   s`  t  j t j d  d d g d d d d d d	 t }  t j d
 |  d t d d  } | j d |  d d  j	   } | j
 d t j  } | j   } | j   } | j   } t j |  } x | j | j d | j | j | j d f D]f } t j j | |  | | k  }	 | j |	  }
 |
 d 9}
 | j |	 |
  t | | d  sę t  qę Wt   GHd  S(   Ns   P21/ct   elementst   Sii
   t   volume_per_atomg2@t   min_distanceg333333ó?t   general_positions_onlyt   crystal_symmetryt   anomalous_flagt   d_mingé?t   xray_structuret	   algorithmt   directt   symmetry_flagsi   i˙˙˙˙gVçŻŇ<(   R   R   R   t   space_group_infot   FalseR   t	   build_sett   Truet!   structure_factors_from_scattererst   f_calct   fft_mapR   t   use_space_group_symmetryt   real_mapt   real_map_unpaddedt   as_1dR   t   min_max_mean_doublet   mint   meant   maxR   t   extt   flip_charges_in_placet   selectt   set_selectedR   t   AssertionErrorR   (   t	   structuret   miller_set_f_obst   f_obsR   t   paddedt   unpaddedt   unpadded_1dt   mmmt   deltat   flipped_selectiont   flipped(    (    sU   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/smtbx/ab_initio/tests/tst_ab_initio_ext.pyt   run   s4    				5
t   __main__N(   t
   __future__R    t   cctbxR   t   cctbx.developmentR   R   R   t   scitbx.array_familyR   t   libtbx.test_utilsR   t   libtbx.utilsR   t   smtbxR   R3   t   __name__(    (    (    sU   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/smtbx/ab_initio/tests/tst_ab_initio_ext.pyt   <module>   s   	$