ó
©™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 j Z d  d l Z d	 „  Z e d
 k r¯ e ƒ  d GHn  d S(   iÿÿÿÿ(   t   division(   t   massage_data(   t   file_reader(   t   random_structure(   t   flex(   t   approx_equal(   t   null_outNc    
   	   C   s§  t  j d ƒ t j d ƒ t j d d# d d d d d	 d
 ƒ }  t |  j d d ƒ j ƒ  ƒ } | j	 ƒ  } d } | j
 d d ƒ j ƒ  j | ƒ t j d | d d d d d d g d t ƒ  ƒ t j d ƒ sÐ t ‚ t j d ƒ } | j j d j ƒ  } | j d | ƒ \ } } xŒ t | j ƒ  | j ƒ  | j ƒ  ƒ D]f \ } } } t | d ƒ t | d ƒ k r2t | | d d d t ƒ  ƒs˜t | | | f ƒ ‚ q2q2Wt j d | d d d d d d g d t ƒ  ƒ t j d ƒ sßt ‚ t j d d d d d  d d d! g d t ƒ  ƒ t j d" ƒ } | j j d j ƒ  }	 |	 j d | ƒ \ }	 } xV t | j ƒ  | j ƒ  |	 j ƒ  ƒ D]0 \ } } } t | | d d ƒsot | ƒ ‚ qoWd  S($   Ni90  t	   unit_celli   i   iZ   t   space_group_symbolt   P1t   n_scattererst   elementst   randomt   d_ming      ø?s   tmp_massage_in.mtzt   column_root_labelt   Ft   argss   aniso.action=Nones   outlier.action=Nones   symmetry.action=twins   twin_law='l,-k,h's   fraction=0.3s   hklout=tmp_massage_twinned.mtzt   outs   tmp_massage_twinned.mtzi    t   otheri   t   epsg{®Gáz„?s   hklout=tmp_massage_twinned.scas   tmp_massage_twinned.scas   symmetry.action=detwins    hklout=tmp_massage_detwinned.mtzs   tmp_massage_detwinned.mtz(   i   i   i   iZ   iZ   iZ   (   R   t   seedR   t   set_random_seedR   t   xray_structuret   abst   structure_factorst   f_calct#   set_observation_type_xray_amplitudet   as_mtz_datasett
   mtz_objectt   writeR   t   runR   t   opt   isfilet   AssertionErrorR   t   any_filet   file_servert   miller_arrayst	   f_sq_as_ft   common_setst   zipt   indicest   dataR   (
   t   xrst   fct   mtz_filet   mtz_int   fc_twint   fc_tmpt   hklt   f1t   f2t	   fc_detwin(    (    sL   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/scaling/tst_massage_data.pyt   exercise_twin_detwin   sf    				
4 ;		
		
4t   __main__t   OK(   t
   __future__R    t   mmtbx.command_lineR   t   iotbxR   t   cctbx.developmentR   t   scitbx.array_familyR   t   libtbx.test_utilsR   t   libtbx.utilsR   t   os.patht   pathR   R   R4   t   __name__(    (    (    sL   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/scaling/tst_massage_data.pyt   <module>   s   	=