ó
ƒ™xTc           @   s3   d  d l  m Z d „  Z e d k r/ e ƒ  n  d S(   iÿÿÿÿ(   t   divisionc          C   sË  d d  l  }  |  j d } d d  l } | j j d | ƒ j ƒ  } xO | D]G } t | j ƒ  ƒ } d | k rG | j ƒ  r{ PqŽ | j	 ƒ  rŽ PqŽ qG qG Wd t | j ƒ  ƒ k o¿ | j	 ƒ  p¿ | j ƒ  sË d GHd  S| j
 ƒ  H| j ƒ  r÷ d GH| j ƒ  } Hn  | j d t ƒ | j ƒ  j ƒ  H| j ƒ  j d d	 ƒ } | j | j ƒ  d
 k ƒ } d G| j ƒ  GHHd d l m } | j | ƒ }	 d d l m }
 d |
 j |	 j ƒ  ƒ |
 j |	 j ƒ  ƒ |
 j |	 j ƒ  j ƒ  ƒ f GHd G|
 j |	 j ƒ  ƒ GHH| j  ƒ  } | j ƒ  } xD t! d ƒ D]6 } |	 j" d | j ƒ  d | d d  d t$ d t ƒ } qW| j% d | ƒ } d d l m& } | j' d | j( ƒ } | j) ƒ  | j* ƒ  j d d ƒ H| j+ d | j, d d
 ƒ ƒ } | j- d d ƒ } d GHd GHx: t. | j/ ƒ  | j0 ƒ  ƒ D] \ } } d  | Gd! | GHqõWHt1 |  j ƒ d" k rÇ|  j d" } | j j d | ƒ j2 d# d$ ƒ } | j ƒ  j3 ƒ  Ht4 | j5 d% | d& d' ƒ j6 ƒ  ƒ } |
 j7 | j ƒ  | j ƒ  ƒ } | j8 ƒ  s¿t9 ‚ d( | j: ƒ  GHH| j; ƒ  } | j< ƒ  j= | j< ƒ  ƒ süt9 ‚ | j> ƒ  | j> ƒ  k st9 ‚ d d) l m? } | j@ d* | ƒ } xC tA | j/ ƒ  ƒ D]/ \ } } | jB | jC d+ d, | d- | ƒ ƒ qOW| jD d. | d/ | d0 d1 d2 t ƒ } x | jE D] } | jF ƒ  q°Wn  d  S(3   Niÿÿÿÿi   t	   file_patht   _meass7   Sorry: CIF does not contain an appropriate miller arrays%   Converting intensities to amplitudes.t   auto_binningt   by_valuet   datag333333ó?s   number of large_e_values:(   t   dmtbx(   t   flexs3   triplets per reflection: min,max,mean: %d, %d, %.2fs   total number of triplets:i
   t
   amplitudest
   phases_radt   selection_fixedt   use_fixed_onlyt   reuse_resultst   phase_source(   t   maptbxt   symmetry_flagst   prefixs   e_map t
   parameterst   min_distance_sym_equivt   max_clusterss   e_map peak lists/          fractional coordinates       peak heights     (%9.6f, %9.6f, %9.6f)s   %10.3fi   t   data_block_namet   It   xray_structuret	   algorithmt   directs%   correlation of f_obs and f_calc: %.4f(   t   euclidean_model_matchingt   special_position_settingst   labels   peak%02dt   sitet   model1t   model2t	   toleranceg      ð?t'   models_are_diffraction_index_equivalent(G   t   syst   argvt	   iotbx.cift   cift   readert   as_miller_arrayst   strt   infot   is_xray_intensity_arrayt   is_xray_amplitude_arrayt   show_comprehensive_summaryt   as_amplitude_arrayt   setup_binnert   Truet   binnert   show_summaryt!   quasi_normalize_structure_factorst   sortt   selectR   t   sizet   cctbxR   t   triplet_generatort   cctbx.array_familyR   t   mint   n_relationst   maxt   meant	   as_doublet   sumt0   random_phases_compatible_with_phase_restrictionst   xranget   apply_tangent_formulat   Nonet   Falset   phase_transferR   t   fft_mapt   use_space_group_symmetryt   apply_sigma_scalingt
   statisticst   peak_searcht   peak_search_parameterst   allt   zipt   sitest   heightst   lent   build_crystal_structurest   show_scattererst   abst!   structure_factors_from_scattererst   f_calct   linear_correlationt   is_well_definedt   AssertionErrort   coefficientt   as_emma_modelt	   unit_cellt   is_similar_tot   space_groupR   t   modelt	   enumeratet   add_positiont   positiont   model_matchest   refined_matchest   show(   R!   t   reflection_file_namet   iotbxt   miller_arrayst   miller_arrayt   st   all_e_valuest   large_e_valuesR   t   tripletsR   t   input_phasest   tangent_formula_phasest   it   e_map_coeffR   t   e_mapRH   t   peaksR   t   heightt   coordinate_file_nameR   RS   t   correlationt   reference_modelt   emmat
   peak_modelt   matchest   match(    (    sQ   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/examples/direct_methods_light.pyt   run   sº    
					
(	!'		t   __main__N(   t
   __future__R    Ry   t   __name__(    (    (    sQ   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/examples/direct_methods_light.pyt   <module>   s   
	j