ó
æxTc           @   so   d  d l  m Z d  d l Z d  d l m Z d  d l m Z d  d l m	 Z	 d   Z
 e d k rk e
   n  d S(   i’’’’(   t   divisionN(   t   flex(   t   random_structure(   t   sgtbxc          C   s®  t  j d t j d  d d g d d d  }  |  j d d  }  d g } g  } x| D]} t |  j d |  j    } | j d | j	   d  } d d g } xµ | D]­ } |  j
   } | j d |  t j   } t j   }	 xZ t d  D]L }
 | j   } t j j d | d | d |  } | j   } | j |  qš W| j t j |   q© WqV W| d d k r~| d d k  st  | d d k r¤| d d k sŖt  d  S(    Nt   space_group_infot   P1t   elementst   Niō  t	   unit_celli   i   i(   iF   iP   ix   t   valuei   g      ų?t   d_mint   datag     ą`@g        g333333Ó?t   mean_distancei
   t   f_obst   r_free_flagst   xray_structurei    gøėQø?i   gÉ?g{®GįzŌ?(   i   i   i(   iF   iP   ix   (   R   R   R   R   t	   set_b_isot   abst   structure_factorst   f_calct   customized_copyR   t   deep_copy_scattererst   shake_sites_in_placeR   t   doublet   xranget   generate_r_free_flagst   mmtbxt   f_modelt   managert   model_error_mlt   appendt   meant   AssertionError(   t   xrst   d_minst   resultR
   R   t   shiftst   xyz_shake_amountt
   xrs_shakent   ml_errt
   ml_err_newt   trialR   t   fmodelt   ml_err_(    (    sN   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/regression/tst_ml_estimate.pyt   run   s6    				&t   __main__(   t
   __future__R    t   mmtbx.f_modelR   t   scitbx.array_familyR   t   cctbx.developmentR   t   cctbxR   R,   t   __name__(    (    (    sN   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/regression/tst_ml_estimate.pyt   <module>   s   	