ó
C™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	 Z
 d  d l Z d d d	 d
 „ Z d „  Z d „  Z e d k r¢ e ƒ  n  d S(   iÿÿÿÿ(   t   division(   t   miller(   t   flex(   t   random_structure(   t   debug_utilsNi   g      @i    c         C   sd  | r |  j  ƒ  }  n  t j |  d d | d d d d d | d t d	 | d
 t ƒ} d s^ | r† | j ƒ  j ƒ  d G| j ƒ  j ƒ  GHn  | j ƒ  } | j	 ƒ  d j
 d k s± t ‚ | j	 ƒ  d j
 d | k sÔ t ‚ | j d t ƒ } d sò | r| j ƒ  j ƒ  n  | j	 ƒ  d j
 j d ƒ \ }	 }
 |	 d k s9t ‚ t |
 ƒ d k sQt ‚ | j	 ƒ  d j
 j d ƒ \ }	 }
 |	 d | k s‰t ‚ t |
 ƒ | j ƒ  j | d ƒ j ƒ  d k s¾t ‚ | j ƒ  j ƒ  d k sÜt ‚ | j d | d | d d ƒ j ƒ  } t j j | ƒ } | j ƒ  } t j | j ƒ  | j ƒ  ƒ d k sHt ‚ t | ƒ } | j ƒ  } t j | j ƒ  | j ƒ  ƒ d k sŠt ‚ t j t | ƒ j ƒ  | j ƒ  ƒ } | j ƒ  sÀt ‚ | j ƒ  d k sØt ‚ d sä| röd G| j ƒ  GHn  | j ƒ  d k st ‚ xÅ t t f D]· } | j | ƒ } | j | ƒ } t j | j ƒ  | j ƒ  ƒ d k sit ‚ | j | ƒ } xW t  | j ƒ  ƒ D]C \ }
 } t! j" j# | | j ƒ  |
 d | ƒ} | d k  s‹t ‚ q‹WqWt | j$ d | d d ƒ j ƒ  ƒ } t j | j ƒ  | j ƒ  ƒ } | j ƒ  s*t ‚ d s6| rHd G| j ƒ  GHn  | j ƒ  d k s`t ‚ d  S(   Nt   elementst   Set   volume_per_atomiÈ   t   random_f_prime_d_ming      ð?t   random_f_double_primet   random_u_isot   use_u_anisot   random_occupancyi    s   n_special_positions:t   Se1iÿÿÿÿs   Se%dt   append_number_to_labelst   _i   t   anomalous_flagt   d_mint	   algorithmt   directi   s   correlation:g+‡ÙÎ÷ï?t   degg�íµ ÷Æ°>t   xray_structure(   R   (%   t   primitive_settingR   R   t   Truet   show_summaryt   show_scattererst   special_position_indicest   sizet   expand_to_p1t
   scattererst   labelt   AssertionErrort   splitt   intt   site_symmetry_tablet   gett   multiplicityt   structure_factorst   f_calcR   t   setR   t   ordert   indicest   abst   linear_correlationt   datat   is_well_definedt   nt   coefficientt   Falset   argt	   enumeratet   scitbxt   matht   phase_errort!   structure_factors_from_scatterers(   t   space_group_infot   use_primitive_settingR   R   t
   n_elementsR   t   verboset	   structuret   structure_p1t   lt   iR&   t   miller_set_p1t	   f_calc_p1t
   amplitudest   amplitudes_p1t   ct	   phase_degt   phasest	   phases_p1t   f_calc_p1_phasest   phaset   et   ctrl_amplitudes_p1(    (    sO   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/regression/tst_expand_to_p1.pyt   exercise	   sv    
	#""	,	**$*%c         C   sž   t  g } | j ƒ  j ƒ  d k r1 | j t ƒ n  xf | D]^ } xU t  t f D]F } x= t  t f D]. } t d | d | d | d | d |  j ƒ q` WqL Wq8 Wd  S(   Nt   PR7   R8   R   R   R:   (   R0   t   groupt!   conventional_centring_type_symbolt   appendR   RK   t   Verbose(   t   flagsR7   t   use_primitive_setting_flagsR8   R   R   (    (    sO   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/regression/tst_expand_to_p1.pyt   run_call_backM   s    	c           C   s   t  j t j d t ƒ d  S(   Ni   (   R   t   parse_options_loop_space_groupst   syst   argvRS   (    (    (    sO   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/regression/tst_expand_to_p1.pyt   run[   s    t   __main__(   t
   __future__R    t   cctbxR   t   cctbx.array_familyR   t   cctbx.developmentR   R   t   scitbx.mathR3   RU   RK   RS   RW   t   __name__(    (    (    sO   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/regression/tst_expand_to_p1.pyt   <module>   s   =		