ó
xTc           @   s{   d  d l  m Z d  d l m Z d  d l Z d  d l m Z d  d l Z d Z	 d   Z
 e d k rw e
 e j d  n  d S(	   i˙˙˙˙(   t   division(   t   reflection_file_serverN(   t   Sorrys   
data = None
  .type = path
labels = None
  .type = strings
symmetry = None
  .type = path
mtz_out = dano_as_fobs.mtz
  .type = path
c   	      C   s  t  j j d |  d t d d d d  } | j j   } | j d  k rT t d   n  | j	 | j  } d  } | j
 d  k	 rŁ d d	 l  m } | j d
 | j
  } n  t d | d t d | j g d t j  } | j d
 | j d | j d t d d d d d t  } | j   st d   n  | j   r9| j   } n  t | j    } | j   | j d d  j   j | j  d | j GHd  S(   Nt   argst   master_phil_stringt   reflection_file_deft   datat   pdb_file_deft   symmetrys   Data file not definedi˙˙˙˙(   t   crystal_symmetry_from_anyt	   file_namet   crystal_symmetryt   force_symmetryt   reflection_filest   errt   labelst   ignore_all_zerost   parameter_scopet    t   minimum_scorei   t   prefer_anomalouss   Must provide anomalous data.t   column_root_labelt   Fs   Wrote DANO to %s(   t   iotbxt   philt   process_command_line_with_filest   master_phil_strt   workt   extractR   t   NoneR   t   get_fileR   R	   t   extract_fromR   t   Truet   file_objectt   syst   stderrt   get_xray_dataR   t   anomalous_flagt   is_xray_intensity_arrayt	   f_sq_as_ft   abst   anomalous_differencest#   set_observation_type_xray_amplitudet   as_mtz_datasett
   mtz_objectt   writet   mtz_out(	   R   t   cmdlinet   paramst   hkl_fileR   R	   t
   hkl_serverR   t   dano(    (    sS   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/command_line/dano_as_amplitudes.pyt   run   sD    						
"t   __main__i   (   t
   __future__R    t   iotbx.reflection_file_utilsR   t
   iotbx.philR   t   libtbx.utilsR   R"   R   R4   t   __name__t   argv(    (    (    sS   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/command_line/dano_as_amplitudes.pyt   <module>   s   	$