ó
P™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 Z d
 „  Z d „  Z d d d „ Z d „  Z d „  Z e d k rÕ e ƒ  n  d	 S(   iÿÿÿÿ(   t   division(   t   xray(   t   adptbx(   t   miller(   t   crystal(   t   debug_utils(   t   flex(   t   user_plus_sys_timeNc   	   	   C   s¯   t  j d t j d t j d |  j d | ƒ d |  ƒ ƒ ƒ } d } t j | ƒ } t j | j	 ƒ  | ƒ } t  j
 d d d	 d d | ƒ } x! t | ƒ D] } | j | ƒ q” W| S(   Nt   special_position_settingst   crystal_symmetryt	   unit_cellt   volumet   space_group_infoi   t   labelt   Ct   siteg°rh‘í|¿?gÁÊ¡E¶óÍ?g®GázÖ?t   u(   g°rh‘í|¿?gÁÊ¡E¶óÍ?g®GázÖ?(   R   t	   structureR   R   t   symmetryt   any_compatible_unit_cellR   t   b_as_ut   u_iso_as_u_starR
   t	   scatterert   xranget   add_scatterer(	   R   R   t   n_scatterersR   t   b_isot   u_isot   u_starR   t   i(    (    sM   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/development/direct_or_fft.pyt   dummy_structure   s    			c         C   sO   t  j d ƒ } x! t | ƒ D] } | j | ƒ q Wt j d |  d | d t ƒ S(	   Ni   i   i   R	   t   indicest   anomalous_flag(   i   i   i   (   (   i   i   i   (   R   t   miller_indexR   t   appendR   t   sett   False(   R	   t   log_n_reflectionsR   R   (    (    sM   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/development/direct_or_fft.pyt   dummy_miller_set   s    	i † g      ø?c         C   s:  t  |  | d ƒ } | j ƒ  t j j d | d | ƒ } xÃ t d d ƒ D]² } t | | ƒ } xš t d d ƒ D]‰ } t  |  | d | ƒ } t ƒ  }	 | d	 | d
 | ƒ }
 d d | d | |	 j ƒ  | j	 d | d | ƒ | j
 d | d | ƒ f GHql WqG W| j
 } d G| j GHd G| j GHd G| j GHd G| j GHd  S(   Ni    R	   t   d_mini   i   i   i
   i   t   xray_structuret
   miller_sets'   %6d %6d %10.3f direct=%10.3f fft=%10.3fs   time_sampling:s	   time_fft:s   time_from_or_to_map:s   time_apply_u_extra:(   R   t   show_summaryR   t   structure_factorst   from_scatterersR   R&   R   t   deltat   estimate_time_directt   estimate_time_fftt   time_samplingt   time_fftt   time_from_or_to_mapt   time_apply_u_extra(   R   R   R'   R	   t!   structure_factors_from_scatterersR%   R)   t   log_n_scatterersR   t   timert   f_calct   e(    (    sM   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/development/direct_or_fft.pyt	   get_times"   s0    
				c         C   s   t  | ƒ d  S(   N(   R9   (   t   flagsR   (    (    sM   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/development/direct_or_fft.pyt   run_call_back<   s    c           C   s   t  j t j d t ƒ d  S(   Ni   (   R   t   parse_options_loop_space_groupst   syst   argvR;   (    (    (    sM   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/development/direct_or_fft.pyt   run?   s    t   __main__(   t
   __future__R    t   cctbxR   R   R   R   t   cctbx.developmentR   t   cctbx.array_familyR   t   libtbx.utilsR   R=   R   R&   R9   R;   R?   t   __name__(    (    (    sM   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/development/direct_or_fft.pyt   <module>   s   					