ó
?™xTc           @   s„   d  d l  m Z d  d l m Z d  d l Z d  d l Z d  d l m	 Z	 d  d l
 m Z d Z d d „ Z e d	 k r€ e ƒ  n  d S(
   iÿÿÿÿ(   t   division(   t   flexN(   t   maptbx(   t   approx_equals“   
CRYST1   10.000   10.000   10.000  90.00  90.00  90.00 P 1
HETATM  120  CA  CA  A   1       5.000   5.000   5.000  1.00 10.00          CA
TER
END
i
   c   
   	   C   s†  t  j j d d  d t ƒ j ƒ  } | j d |  ƒ } | j d d d d d d	 g ƒ d
 d
 d
 g } | j ƒ  j	 ƒ  | d | d | d } t
 j j d | d | ƒ j ƒ  | } t j d | d | j ƒ  d | j ƒ  d d d ƒ \ } } t j ƒ  } | j j d ƒ } x' | D] }	 | j | j |	 |  ƒ ƒ qW| | } t t j | ƒ d d ƒ s]t ‚ t j t | | ƒ ƒ d k  s‚t ‚ d  S(   Nt   source_infot   linest   valuet   tablet
   n_gaussiant   d_ming        t'   types_without_a_scattering_contributiont   ?id   i    i   i   t   xray_structuret   n_realt   map_datat	   unit_cellt   center_cartt   radiusg      @t   Cai   gš™™™™™¹?g-Cëâ6?(   t   iotbxt   pdbt   inputt   Nonet   pdb_strt   xray_structure_simplet	   set_b_isot   scattering_type_registryR   t   volumet   mmtbxt
   real_spacet   sampled_model_densityt   dataR   t   map_peak_3d_as_2dt
   sites_cartR   t   doublet   _scattering_type_registryt   gaussiant   appendt   electron_densityR   t   sumt   AssertionErrort   meant   abs(
   t   b_isot   xrsR   t   pixel_volumet   map_data_3dt   distt   map_data_2dt   map_data_2d_exactt   edt   r(    (    sP   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/tst_map_peak_3d_as_2d.pyt   run   s.    !	
*	
!t   __main__(   t
   __future__R    t   scitbx.array_familyR   t	   iotbx.pdbR   t   mmtbx.real_spaceR   t   cctbxR   t   libtbx.test_utilsR   R   R4   t   __name__(    (    (    sP   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/tst_map_peak_3d_as_2d.pyt   <module>   s   