ó
¬™xTc           @   s0   d  Z  d d l m Z d e f d „  ƒ  YZ d S(   s¦   
the parameters should have this scope
  omit {
    perform_omit = True
    fraction = 0.15
    max_number = 1e5
    number_of_sets = 100
    root_name = 'omit_'
  }
iÿÿÿÿ(   t   divisiont   random_omit_datac           B   s   e  Z d  „  Z d „  Z RS(   c         C   s   | |  _  | |  _ d  S(   N(   t   miller_arrayt
   parameters(   t   selfR   R   (    (    sG   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/scaling/random_omit.pyt   __init__   s    	c         C   sÖ   t  |  j j d d ƒ } x¶ t |  j j ƒ D]¢ } |  j j t | ƒ d } | d | | f IJ|  j j d |  j j d |  j j	 d t
 ƒ } |  j j | j ƒ  ƒ } | j d d	 ƒ } | j ƒ  j d
 | ƒ q, Wd  S(   Ns   exec.comt   ws   .mtzs%   __REPLACE_1__%s__REPLACE_2__ > %s.logt   fractiont   max_freet   use_lattice_symmetryt   column_root_labelt   Fdeltat	   file_name(   t   openR   t	   root_namet   xranget   number_of_setst   strR   t   generate_r_free_flagsR   t
   max_numbert   Falset   selectt   datat   as_mtz_datasett
   mtz_objectt   write(   R   t   comfilet   nthR   t
   tmp_selectt
   tmp_millert   tmp_mtz_dataset(    (    sG   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/scaling/random_omit.pyt   write_datasets   s    			(   t   __name__t
   __module__R   R   (    (    (    sG   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/scaling/random_omit.pyR      s   	N(   t   __doc__t
   __future__R    t   objectR   (    (    (    sG   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/scaling/random_omit.pyt   <module>
   s   