ó
Ž™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 e d k r° e ƒ  d GHn  d	 S(   iÿÿÿÿ(   t   division(   t   show_systematic_absences(   t   random_structure(   t   sgtbx(   t   flex(   t   Sorry(   t   Exception_expected(   t   StringIONc    	      C   sN  t  j d ƒ t j d ƒ t j t j d ƒ d d g d ƒ}  |  j d d ƒ j	 ƒ  } t
 | ƒ j ƒ  j ƒ  } | j d t j d	 ƒ d
 t  j | j ƒ  d ƒ ƒ } | j ƒ  } | j d | ƒ } | j d t  j | j ƒ  d ƒ d
 t  j | j ƒ  d ƒ ƒ } | j d | ƒ j ƒ  } | j d d ƒ d g } t ƒ  } y t j d | d | ƒ Wn t k
 rcn Xt ‚ | j d j g  |  j ƒ  j ƒ  D] } t | ƒ ^ q‰ƒ ƒ t j d | d | ƒ | j ƒ  j  d ƒ d k sÜt! ‚ | j d
 d  ƒ } | j# d d ƒ j$ ƒ  j% d ƒ d g } y t j d | d | ƒ Wn t k
 rCn Xt ‚ d  S(   Ni90  t   P21212t   elementst   constid   t   d_ming      @t   space_group_infot   P222t   sigmasg      ð?t   othert   datai   i
   t	   file_names   tst_sys_absent.scat   argst   outt   ,s%     (   0,    3,    0): i/sigi =    0.5i   t   column_root_labelt   Is   tst_sys_absent.mtz(&   R   t   set_random_seedt   randomt   seedR   t   xray_structureR   R   t   structure_factorst   f_calct   abst	   f_as_f_sqt#   set_observation_type_xray_intensityt   customized_copyt   doublet   sizet   complete_sett   lone_sett   arrayt   concatenatet   export_as_scalepack_unmergedR   R   t   runR   R   t   appendt   joint	   unit_cellt
   parameterst   strt   getvaluet   countt   AssertionErrort   Nonet   as_mtz_datasett
   mtz_objectt   write(	   t   xrsR   t   i_calcR#   R$   t   i_absR   R   t   x(    (    s[   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/regression/tst_show_systematic_absences.pyt   exercise   sD    	!		;!	t   __main__t   OK(   t
   __future__R    t   iotbx.command_lineR   t   cctbx.developmentR   t   cctbxR   t   scitbx.array_familyR   t   libtbx.utilsR   t   libtbx.test_utilsR   t	   cStringIOR   R   R9   t   __name__(    (    (    s[   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/regression/tst_show_systematic_absences.pyt   <module>   s   	&