ó
±™xTc           @   sz   d  Z  d d l m Z d d l m Z d d l j Z d d l Z d Z	 e j
 d „ Z e d k rv e e j d ƒ n  d S(	   s>   
Tool for modifying experimental data, spun off from Xtriage.
iÿÿÿÿ(   t   division(   t   SorryNs˜  
crystal_symmetry {
  space_group = None
    .type = space_group
  unit_cell = None
    .type = unit_cell
  symm_file = None
    .type = path
}
input {
  data = None
    .type = path
    .help = Data file
  labels = None
    .type = strings
}
options {
  include scope mmtbx.scaling.massage_twin_detwin_data.master_params
}
output {
  include scope mmtbx.scaling.massage_twin_detwin_data.output_params_str
}
c         C   sÓ  d d  l  } | j j d |  d t d d d d d d	 d
 d d d ƒ } | j j ƒ  } | j j d  k ru t	 d ƒ ‚ n  d d l
 m } d d l m } d d l m } d d l m } d  }	 }
 } | j j d  k	 rä | j j }
 n  | j j d  k	 r| j j } n  d  }	 | j j d  k	 r]| j d | j j ƒ }	 |	 d  k r]t	 d | j j ƒ ‚ q]n  |	 d  k r–d  |
 | g k r–| j d |
 d | ƒ }	 n  | j | j j ƒ } | j d |	 d t d | j g d t j ƒ } | j d | j j d | j j d t d d d t d  t ƒ } | j  d! | d" | j! d# | ƒ } | j" j# d  k r¡t$ j% t$ j& | j j ƒ ƒ d$ } | j" j' d+ k rŽ| d' | j" _# q¡| d( | j" _# n  | j( d | j" j# d) | j" j' d* | j" j) ƒ d  S(,   Niÿÿÿÿt   argst   master_phil_stringt   pdb_file_defs   crystal_symmetry.symm_filet   reflection_file_defs
   input.datat   space_group_defs   crystal_symmetry.space_groupt   unit_cell_defs   crystal_symmetry.unit_cellt   usage_stringsÜ   mmtbx.massage_data data.mtz [labels=I,SIGI] [options]

Modification of experimental data: remove anisotropy, apply B-factor, filter
negative intensities, add or remove twinning.  For expert use (and extreme
cases) only.
s   No data file supplied.(   t   massage_twin_detwin_data(   t   crystal_symmetry_from_any(   t   reflection_file_utils(   t   crystalt	   file_names!   No crystal symmetry defined in %st   space_group_infot	   unit_cellt   crystal_symmetryt   force_symmetryt   reflection_filest   errt   labelst   ignore_all_zerost   parameter_scopet   inputt   prefer_anomaloust   prefer_amplitudest   miller_arrayt
   parameterst   outi    t   Autot   mtzs   .mtzs   .scat   output_typet   label_extension(   R   R   (*   t
   iotbx.philt   philt   process_command_line_with_filest   master_phil_strt   workt   extractR   t   datat   NoneR   t   mmtbx.scalingR	   t   iotbxR
   R   t   cctbxR   R   t   space_groupR   t	   symm_filet   extract_fromt   symmetryt   get_filet   reflection_file_servert   Truet   file_objectt   syst   stderrt   get_xray_dataR   t   Falset   massage_datat   optionst   outputt   hkloutt   opt   splitextt   basenamet   hklout_typet
   write_dataR    (   R   R   R*   t   cmdlinet   paramsR	   R
   R   R   R   R,   R   t   hkl_int
   hkl_serverR'   t   resultt	   file_base(    (    sM   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/command_line/massage_data.pyt   run#   st    									"	t   __main__i   (   t   __doc__t
   __future__R    t   libtbx.utilsR   t   os.patht   pathR<   R4   R$   t   stdoutRG   t   __name__t   argv(    (    (    sM   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/command_line/massage_data.pyt   <module>   s   C