ó
�™xTc           @   s�   d  d l  m Z d  d l m Z d  d l m Z d  d l 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   file_reader(   t	   map_toolsN(   t   mtz(   t   flexc       	   C   sø  d }  |  d } |  d } t  j j j d d ƒ } | j j ƒ  } t | d ƒ j | j j | ƒ ƒ | j d d ƒ j	 ƒ  } t
 j d	 d
 ƒ } | j d d d | ƒ } | j | d d d | ƒ| j | d d d | ƒ| j | d d d | ƒ| j ƒ  j | ƒ t j d | d | ƒ } d  | j | j | j g k s?t ‚ | j d k sTt ‚ | j d k sit ‚ t j | ƒ }	 |	 j d |  ƒ }
 g  |
 D] } t j j | ƒ ^ q‘}
 |
 d d d d g k sÍt ‚ x3 |
 D]+ } t j j | ƒ sòt ‚ t j | ƒ qÔW|	 j d d d d  d d  d t ƒ } | d k s9t ‚ t j j | ƒ sQt ‚ | j d d d t
 j  ƒ  ƒ } | j | d d d t
 j  ƒ  ƒ| j ƒ  j | ƒ t j d | d | ƒ } d  | j | j g k s×t ‚ | j d  k sìt ‚ | j d k st ‚ t j | ƒ }	 |	 j! d | ƒ } g  | D] } t j j | ƒ ^ q)} | d  d! g k s_t ‚ | j d d d t
 j  ƒ  ƒ } t" | ƒ } | j# ƒ  } | j$ d" t% j& | j' ƒ  j( ƒ  d# ƒ d$ d  ƒ } | j | d d% ƒ| j | d d& ƒ| j | d d' ƒ| j ƒ  j | ƒ t j | ƒ }	 |	 j) d d  d( t* ƒ } | d) k sJt ‚ t j j+ | ƒ sbt ‚ t j, d* | | j- ƒ  | | g d+ d d, d- d. g d/ d0 ƒ t. j/ d0 ƒ } g  | j0 j1 D] } | j2 ƒ  j3 ƒ  ^ q¸} | d d1 d2 d3 g k sôt ‚ d  S(4   Nt   tmp_iotbx_map_toolss   .pdbs   .mtzt
   pdb_stringsÇ  ATOM      1  N   GLY P  -1     -22.866  -2.627  15.217  1.00  0.00           N
ATOM      2  CA  GLY P  -1     -22.714  -3.068  16.621  1.00  0.00           C
ATOM      3  C   GLY P  -1     -21.276  -3.457  16.936  1.00  0.00           C
ATOM      4  O   GLY P  -1     -20.538  -3.887  16.047  1.00  0.00           O
ATOM      5  H1  GLY P  -1     -22.583  -3.364  14.590  1.00  0.00           H
ATOM      6  H2  GLY P  -1     -22.293  -1.817  15.040  1.00  0.00           H
ATOM      7  H3  GLY P  -1     -23.828  -2.392  15.027  1.00  0.00           H
ATOM      8  HA2 GLY P  -1     -23.016  -2.261  17.288  1.00  0.00           H
ATOM      9  HA3 GLY P  -1     -23.352  -3.933  16.803  1.00  0.00           H
t   wt   d_ming      ø?t   phases_prefixt   PHt   column_root_labelt   2FOFCWTt   label_decoratort   2FOFCWT_no_fillt   FOFCWTt   ANOMt   mtz_filet   pdb_files!   tmp_iotbx_map_tools_2mFo-DFc.ccp4s   2mFo-DFct	   file_bases"   tmp_iotbx_map_tools_anomalous.ccp4s    tmp_iotbx_map_tools_mFo-DFc.ccp4s)   tmp_iotbx_map_tools_2mFo-DFc_no_fill.ccp4t   f_labels   2FOFCWT,PH2FOFCWTt	   phi_labelt	   fom_labelt   use_standard_map_namest   FWTt   DELFWTs   tmp_iotbx_map_tools_FWT.ccp4s   tmp_iotbx_map_tools_DELFWT.ccp4t   datai   t   observation_typet   FPt   PHIMt   FOMMt   forces   tmp_iotbx_map_tools.ccp4t
   map_coeffst	   map_typess   mFo-DFct   anomt   othert	   file_names   tmp_iotbx_map_tools2.mtzs   FOFCWT,PHFOFCWTs   ANOM,PHANOMs   other,PHother(4   t   iotbxt   pdbt	   hierarchyt   inputt   xray_structure_simplet   opent   writet   as_pdb_stringt   structure_factorst   f_calcR   R   t   as_mtz_datasett   add_miller_arrayt
   mtz_objectR   t   auto_convert_map_coefficientst   Nonet   f_mapt   diff_mapt   anom_mapt   AssertionErrort
   f_map_typet   servert   convert_phenix_mapst   ost   patht   basenamet   isfilet   removet   convert_any_mapt   Truet   ccp4_label_decoratort   convert_ccp4_mapt   abst   phasest   customized_copyR   t   doubleR   t   sizet   convert_resolve_mapt   Falset   existst   write_map_coefficients_generict   generate_bijvoet_matesR   t   any_filet   file_servert   miller_arrayst   infot   label_string(   t   prefixR   R   t   pdb_int   xrst   fct   dect   mtz_datat	   convertedR9   t   filesR$   t   fnt	   map_filest   amplRE   t   fomt   map_filet   mtz_int   at   labels(    (    sL   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/regression/tst_map_tools.pyt   exercise_map_tools
   s®    


	"				$%					%					+t   __main__t   OK(   t
   __future__R    R%   R   R   t   iotbx.pdb.hierarchyR   t   scitbx.array_familyR   R;   Rc   t   __name__(    (    (    sL   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/regression/tst_map_tools.pyt   <module>   s   	f