ó
?™xTc           @   s  d  d l  m Z d  d l Z d  d l Z e j j d ƒ Z d  d l	 Td  d l m
 Z
 d  d l m Z d  d l m Z d  d l m Z d  d	 l m Z d  d
 l m Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z e j j d d ƒ Z d „  Z e e j _ e e j _ e e j _ e  e j _  d d d e! d „ Z" d d „ Z# d d „ Z$ d „  Z% d e j& f d „  ƒ  YZ& d e j j' e j& f d „  ƒ  YZ( e j) d e! ƒ Z* d e j j' e j+ f d „  ƒ  YZ( d e j, f d „  ƒ  YZ, e! d „ Z- e j. d  e/ d! e0 ƒ Z1 d" e2 f d# „  ƒ  YZ3 d$ e3 f d% „  ƒ  YZ4 d& e2 f d' „  ƒ  YZ5 d( e2 f d) „  ƒ  YZ6 d* e2 f d+ „  ƒ  YZ7 d, e2 f d- „  ƒ  YZ8 d. „  Z9 d d/ d0 „ Z; d1 e2 f d2 „  ƒ  YZ< d3 „  Z= d4 e2 f d5 „  ƒ  YZ> d6 d d d7 „ Z? d8 e2 f d9 „  ƒ  YZ@ d S(:   iÿÿÿÿ(   t   divisionNt   cctbx_maptbx_ext(   t   *(   t   crystal(   t   sgtbx(   t   flex(   t   matrix(   t   dicts(   t   adopt_init_argst(   CCTBX_MAPTBX_DEBUG_PEAK_CLUSTER_ANALYSISt    c         C   s   |  t  |  j ƒ  | ƒ S(   N(   t   closest_grid_pointt   accessor(   t   mapt   x_frac(    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyt   value_at_closest_grid_point   s    i   i   i
   c         C   s(   t  j d |  d | d | d | d | ƒ S(   sa   
  Good defaults for 2mFo-DFc type maps:
    smearing_b=1, max_peak_scale=100, smearing_span=5
  t   n_realt
   smearing_bt   max_peak_scalet   smearing_spant   use_exp_table(   t   extt   map_accumulator(   R   R   R   R   R   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyR      s    g      ø?c   	      C   sº   t  j ƒ  } xˆ | D]€ } t d | j ƒ  d |  j ƒ  d |  j ƒ  d t  j | g ƒ d t  j | g d ƒ ƒ } | j |  j | ƒ | k j	 t
 ƒ ƒ q Wt  j | ƒ } | d k r¶ d  S| S(   Nt	   unit_cellt
   fft_n_realt
   fft_m_realt
   sites_cartt
   site_radiii   i    (   R   t   doublet   grid_indices_around_sitesR   t   focust   allt   vec3_doublet   appendt   selectt   countt   Truet   mint   None(	   t   map_dataR   t   crystal_symmetryt   cutofft   atom_radiust   vt   sct   selt   r(    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyt   peak_volume_estimate(   s    ) i    c         C   sX   t  |  ƒ j ƒ  } | d k r, |  | }  d St j d |  d | d | d | d | ƒ d S(   sí   
  Trunate map inplace by standard deviation (sigma) while scale it with
  specified scale, such as volume (scale_by=1/volume) or sigma
  (scale_by=1/standard_deviation). Input map_data is expected to be unscaled (
  right out of FT).
  i    NR'   t   standard_deviationt   by_sigma_less_thant   scale_byt	   set_value(   t
   statisticst   sigmaR   t   truncate(   R'   R1   R2   R3   R5   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyR6   7   s    
	c      	   C   si   |  j  d t ƒ } d d l m } | d | ƒ } | | } t j d | j ƒ  d | j ƒ  d | d | ƒ S(	   Nt   sites_mod_positiveiÿÿÿÿ(   t   vdw_radii_from_xray_structuret   xray_structuret
   sites_fracR   R   t   radii(   t   expand_to_p1R$   t   cctbx.masksR8   R   t   maskR:   R   (   R9   R   t   solvent_radiust   xrs_p1R8   R;   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyR>   I   s    
	R4   c           B   s   e  Z d  „  Z RS(   c         C   s   t  j j |  | ƒ d  S(   N(   R   R4   t   __init__(   t   selfR   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyRA   V   s    (   t   __name__t
   __module__RA   (    (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyR4   T   s   t   _c           B   s   e  Z d d  d „ Z RS(   R
   c         C   s|   | d  k r t j } n  | | d |  j ƒ  IJ| | d |  j ƒ  IJ| | d |  j ƒ  IJ| | d |  j ƒ  IJd  S(   Ns   max %.6gs   min %.6gs	   mean %.6gs
   sigma %.6g(   R&   t   syst   stdoutt   maxR%   t   meanR5   (   RB   t   ft   prefix(    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyt   show_summary[   s     N(   RC   RD   R&   RL   (    (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyRE   Y   s   t   use_space_group_symmetryc           B   s   e  Z d  Z d „  Z RS(   s3   
  Injector for extending cctbx.maptbx.histogram
  c         C   s÷  | j  ƒ  } | j ƒ  } d } x> t |  j ƒ  ƒ D]* \ } } | d | k r1 | d } Pq1 q1 W| d k sq t ‚ |  j ƒ  | }	 | j | |	 k ƒ }
 t t | | d ƒ |
 j ƒ  ƒ } t	 j
 |
 ƒ } |
 j | ƒ } ~ | j ƒ  | k sò t ‚ | | } ~
 ~ d } x: t |  j ƒ  ƒ D]& \ } } | d | k r| } PqqW| d k sXt ‚ |  j ƒ  | } | j | | k ƒ } t t | | d ƒ | j ƒ  d ƒ } t	 j
 | ƒ } | j | ƒ } ~ | j ƒ  | k sÝt ‚ | | } ~ ~ | | f S(   sŸ  
    For the double-step filtration in cctbx.miller (used as part of the
    procedure for replacing missing F-obs in maps), we need to calculate upper
    and lower cutoffs for the data based on percentile values.  This can be
    done in just a few lines of code by using flex.sort_permutation over the
    entire map, but this has a huge memory overhead (and possibly computational
    overhead as well).  Since we are only interested in subsets of values at
    the extreme ends of the distribution, we can perform the sort for these
    subsets instead, which should cut down on memory use.

    Returns the upper and lower map value cutoffs (as Python floats).
    iÿÿÿÿid   i   i    g      Y@(   t   as_1dt   sizet	   enumeratet   v_valuest   AssertionErrort	   argumentsR"   R%   t   intR   t   sort_permutationt   c_values(   RB   R   t   vol_cutoff_plus_percentt   vol_cutoff_minus_percentt
   map_valuesRO   t
   i_bin_plust   i_bint   valuet   cutoffp_lower_limitt
   top_valuest   i_uppert   st   top_values_sortedt   cutoffpt   i_bin_minust   cutoffm_upper_limitt   bottom_valuest   i_lowert   bottom_values_sortedt   cutoffm(    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyt   get_percentile_cutoffsj   sJ    

(   RC   RD   t   __doc__Ri   (    (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyRE   e   s   t	   peak_listc           B   s   e  Z d  d d e d „ Z RS(   i   i    c         C   sT   | d  k r. t j j |  | | | | | ƒ n" t j j |  | | | | | | ƒ d  S(   N(   R&   R   Rk   RA   (   RB   t   datat   tagst   peak_search_levelt	   max_peakst   peak_cutofft   interpolate(    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyRA   ¢   s
    N(   RC   RD   R&   R$   RA   (    (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyRk       s   c         C   s   t  j |  | | | ƒ S(   N(   R   t   as_CObjectZYX(   t   map_unit_cellt   firstt   lastt   apply_sigma_scaling(    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyRr   ¯   s    t   to_mapt   from_mapt   crystal_griddingc        
   B   sª   e  Z d d d d d d d  e d d „	 Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d „  Z d	 „  Z d
 „  Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   i   c      	   C   sq  |
 d  k r² | | g j d  ƒ d k s- t ‚ | d  k	 rL | d } d } n | d  k ra d } n  | d  k	 r‚ | d  k	 s‚ t ‚ n  | d  k r— d } n  t | ƒ d k sè t ‚ n6 | d  k sÄ t ‚ | d  k sÖ t ‚ | d  k sè t ‚ t |  t ƒ  d t ƒ|
 d  k	 r|
 |  _ nW | d  k	 rOt | | | | | j	 ƒ  | | |	 ƒ |  _ n t | | | | | |	 ƒ |  _ d  S(   Ni   i   g      à?i   t   hidegUUUUUUÕ?(   i   i   i   (
   R&   R#   RR   t   lenR   t   localsR$   t   _n_realt   determine_griddingt   type(   RB   R   t   d_mint   resolution_factort   stept   symmetry_flagst   space_group_infot   mandatory_factorst	   max_primet   assert_shannon_samplingt   pre_determined_n_real(    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyRA   ¸   s4    
!
		  			c         C   sd   | j  |  _  | j |  _ | j |  _ | j |  _ | j |  _ | j |  _ | j |  _ | j |  _ d  S(   N(   t
   _unit_cellt   _d_mint   _resolution_factort   _symmetry_flagst   _space_group_infot   _mandatory_factorst
   _max_primeR}   (   RB   t   other(    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyt   _copy_constructorÝ   s    c         C   s   |  j  S(   N(   R‰   (   RB   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyR   ç   s    c         C   s   |  j  S(   N(   RŠ   (   RB   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyR€   ê   s    c         C   s   |  j  S(   N(   R‹   (   RB   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyR�   í   s    c         C   s   |  j  S(   N(   RŒ   (   RB   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyRƒ   ð   s    c         C   s   |  j  S(   N(   R�   (   RB   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyR„   ó   s    c         C   s:   | j  ƒ  j |  j ƒ  ƒ |  j ƒ  k s- t ‚ | |  _ d  S(   N(   t   groupt   refine_griddingR   RR   R�   (   RB   R„   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyt   change_space_groupö   s    c         C   s   |  j  S(   N(   RŽ   (   RB   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyR…   û   s    c         C   s   |  j  S(   N(   R�   (   RB   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyR†   þ   s    c         C   s   |  j  S(   N(   R}   (   RB   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyR     s    c         C   s(   |  j  ƒ  d  k	 s t ‚ |  j  ƒ  j ƒ  S(   N(   R„   R&   RR   R’   (   RB   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyt   space_group  s    c         C   s:   |  j  ƒ  d  k	 s t ‚ t j d |  j ƒ  d |  j  ƒ  ƒ S(   NR   R„   (   R„   R&   RR   R   t   symmetryR   (   RB   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyR(     s    	c         C   s+   d } x |  j  ƒ  D] } | | 9} q W| S(   Ni   (   R   (   RB   t   resultt   n(    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyt   n_grid_points  s    c         C   s
   t  |  ƒ S(   N(   t   crystal_gridding_tags(   RB   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyRm     s    N(   RC   RD   R&   R$   RA   R‘   R   R€   R�   Rƒ   R„   R”   R…   R†   R   R•   R(   R™   Rm   (    (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyRy   ¶   s.   	
												Rš   c           B   s&   e  Z d  „  Z d „  Z e d „ Z RS(   c         C   sŠ   t  j |  | ƒ | j ƒ  d  k	 s( t ‚ t d |  j ƒ  ƒ |  _ |  j j d |  j	 ƒ  j
 ƒ  d |  j ƒ  ƒ |  j j ƒ  d k s† t ‚ d  S(   Nt   dimt   space_group_typeRƒ   i    (   Ry   R‘   Rƒ   R&   RR   t	   grid_tagsR   t   _tagst   buildR„   R   t   n_grid_misses(   RB   t   gridding(    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyRA     s    c         C   s   |  j  S(   N(   Rž   (   RB   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyRm   "  s    c         C   sa  | d  k r t ƒ  } n  | rE t j j rE |  j j | ƒ sE t ‚ n  | j ƒ  j	 ƒ  rx t
 | t j | j ƒ  ƒ ƒ } n  t d | d |  j j ƒ  d | j ƒ  d | j ƒ  d | j ƒ  d | j ƒ  ƒ } | j ƒ  d  k rÜ | St d | d t j d	 |  j ƒ  d
 | j ƒ  ƒ d | j ƒ  d | j ƒ  d | j ƒ  d | j ƒ  d | j ƒ  d | j ƒ  d | j ƒ  ƒ 	S(   NRl   Rm   Rn   Ro   Rp   Rq   Rk   t   special_position_settingsR(   t   min_distance_sym_equivt   general_positions_onlyt   effective_resolutiont   significant_height_fractiont   cluster_height_fractiont   min_cross_distancet   max_clusterst   min_cubicle_edge(    R&   t   peak_search_parameterst   libtbxt   envt   full_testingRž   t   verifyRR   R   t	   is_paddedt   copyR   t   gridR   Rk   t	   tag_arrayRn   Ro   Rp   Rq   R£   t   peak_cluster_analysisR   R¢   R(   R¤   R¥   R¦   R§   R¨   R©   Rª   (   RB   t
   parametersR   t   verify_symmetryt
   grid_peaks(    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyt   peak_search%  s6    !	(   RC   RD   RA   Rm   R$   R¸   (    (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyRš     s   			t   boxesc           B   s)   e  Z d  Z d d d d „ Z d „  Z RS(   s]   
  Split box defined by n_real into boxes where each box is a fraction of the
  whole box.
  R
   c         C   s  | |  _  | d } t | d | ƒ t | d | ƒ t | d | ƒ } } } | rà | | Id I| IJ| | Id I| I| I| IJ| | Id I| d | | d | | d | | d | d | d IJn  d	 „  }	 g  }
 x[ t | | | g ƒ D]D \ } } |  j d
 |  j  | d | ƒ } |	 | ƒ } |
 j | ƒ qWg  |  _ g  |  _ x† |
 d D]z } xq |
 d D]e } x\ |
 d D]P } |  j j | d | d | d g ƒ |  j j | d | d | d g ƒ qŒWq{WqjW| r| | Id It |  j ƒ IJn  d  S(   Ng      ð?i   i    i   i   s   n1,n2,n3 (n_real)  :s   points per box edge:s   Vbox/Vall          :c         S   sÄ   |  t  |  ƒ d d } t | t  |  ƒ ƒ } g  } x‰ t t  |  ƒ ƒ D]u } | d k rh d } | } nA | t  |  ƒ d k r‘ | | } | } n | | } | d | } | j | | g ƒ qG W| S(   Ni   i    (   R{   RT   t   xrangeR!   (   t   bet   maxeR‚   R—   t   it   lR.   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyt   regroupT  s    	
	
t	   n_real_1dR‚   s   number of boxes    :gUUUUUUÕ?(   R   RT   RP   t
   _box_edgesR!   t   startst   endsR{   (   RB   R   t   fractiont   logRK   RJ   t   bat   bbt   bcR¿   R»   R½   t   bt   be_t   jt   k(    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyRA   G  s.    	
>"A	"		%1 c         C   sÆ   g  } x' t  d | | ƒ D] } | j | ƒ q W| j | ƒ g  } x| t t | ƒ ƒ D]h } | d k r† | j | d | d g ƒ qV | t | ƒ d k rV | j | | | | d g ƒ qV qV W| S(   Ni    i   (   t   rangeR!   Rº   R{   (   RB   RÀ   R‚   t   limitsR½   t   box_1d(    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyRÁ   r  s       &N(   RC   RD   Rj   R&   RA   RÁ   (    (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyR¹   B  s
   'R«   c           B   sª   e  Z d  d d e d e d d d d d d d „ Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d	 „  Z d
 „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   i   i    i   c         C   s   t  |  t ƒ  d t ƒd  S(   NRz   (   R   R|   R$   (   RB   Rn   Ro   Rp   Rq   R£   R¤   R¥   R¦   R§   R¨   R©   Rª   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyRA   ~  s    c         C   s”   | j  |  _  | j |  _ | j |  _ | j |  _ | j |  _ | j |  _ | j |  _ | j |  _ | j |  _ | j	 |  _	 | j
 |  _
 | j |  _ d  S(   N(   t   _peak_search_levelt
   _max_peakst   _peak_cutofft   _interpolatet   _min_distance_sym_equivt   _general_positions_onlyt   _effective_resolutiont   _significant_height_fractiont   _cluster_height_fractiont   _min_cross_distancet   _max_clusterst   _min_cubicle_edge(   RB   R�   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyR‘   Œ  s    c         C   s   |  j  S(   N(   RÐ   (   RB   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyRn   š  s    c         C   s   |  j  S(   N(   RÑ   (   RB   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyRo   �  s    c         C   s   |  j  S(   N(   RÒ   (   RB   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyRp      s    c         C   s   |  j  S(   N(   RÓ   (   RB   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyRq   £  s    c         C   s   |  j  S(   N(   RÔ   (   RB   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyR£   ¦  s    c         C   s   |  j  S(   N(   RÕ   (   RB   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyR¤   ©  s    c         C   s   |  j  S(   N(   RÖ   (   RB   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyR¥   ¬  s    c         C   s   |  j  S(   N(   R×   (   RB   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyR¦   ¯  s    c         C   s   |  j  S(   N(   RØ   (   RB   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyR§   ²  s    c         C   s   |  j  S(   N(   RÙ   (   RB   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyR¨   µ  s    c         C   s   |  j  S(   N(   RÚ   (   RB   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyR©   ¸  s    c         C   s   |  j  S(   N(   RÛ   (   RB   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyRª   »  s    N(   RC   RD   R&   R$   t   FalseRA   R‘   Rn   Ro   Rp   Rq   R£   R¤   R¥   R¦   R§   R¨   R©   Rª   (    (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyR«   |  s2   												t   cluster_site_infoc           B   s   e  Z d  „  Z RS(   c         C   s1   | |  _  | |  _ | |  _ | |  _ | |  _ d  S(   N(   t   peak_list_indext
   grid_indext   grid_heightt   sitet   height(   RB   RÞ   Rß   Rà   Rá   Râ   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyRA   À  s
    				(   RC   RD   RA   (    (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyRÝ   ¾  s   R´   c           B   s
  e  Z e d d d d d d  d „ Z d „  Z d d „ Z d „  Z d „  Z d „  Z	 d „  Z
 d „  Z d	 „  Z d
 „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d d „ Z d „  Z d „  Z d d „ Z d „  Z d „  Z d d „ Z RS(   i   c
   
   	   C   sj  | d  k	 r9 | d  k r! d } n  | d  k r9 d } q9 n  | d  k rT | j ƒ  } n  t |  t ƒ  d t ƒ|  j d  k	 s t ‚ | j ƒ  |  _ | d  k	 r¸ t	 j
 | j ƒ  t ƒ |  _ n	 d  |  _ | d  k	 sÙ t d k rå d  |  _ n< |  j j d |  j d |  j j ƒ  d |  j d	 |  j ƒ |  _ t	 j ƒ  |  _ d
 |  _ t	 j ƒ  |  _ t	 j ƒ  |  _ t	 j ƒ  |  _ d  S(   Ni   i   i   Rz   t   use_oldR¨   t   min_self_distanceR¤   Rª   i    gš™™™™™É?gUUUUUUÕ?(   R&   R£   R   R|   R$   RÙ   RR   R¡   t	   _griddingR   t   boolRO   RÜ   t   _is_processedt   debug_peak_cluster_analysist   _site_cluster_analysist   _special_position_settingst   site_cluster_analysisRÕ   RÛ   t   size_tt   _peak_list_indicest   _peak_list_indexR    t   _sitesR   t   _heightst   _fixed_site_indices(
   RB   Rk   R¢   R¤   R¥   R¦   R§   R¨   R©   Rª   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyRA   É  s4    						c         C   s'   |  j  d  k	 r |  j ƒ  S|  j ƒ  Sd  S(   N(   RÖ   R&   t   next_with_effective_resolutiont   next_site_cluster_analysis(   RB   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyt   nextñ  s    
c         C   s3   |  j  d  k	 r |  j d | ƒ S|  j d | ƒ Sd  S(   NR©   (   RÖ   R&   t   all_with_effective_resolutiont   all_site_cluster_analysis(   RB   R©   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyR   ÷  s    c         c   s+   x$ |  j  ƒ  } | d  k r Pn  | Vq d  S(   N(   Rô   R&   (   RB   t	   site_info(    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyt   __iter__ý  s
     c         C   s   |  j  S(   N(   t
   _peak_list(   RB   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyRk     s    c         C   s   |  j  S(   N(   Rê   (   RB   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyR¢     s    c         C   s   |  j  S(   N(   RÕ   (   RB   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyR¤   	  s    c         C   s   |  j  S(   N(   RÖ   (   RB   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyR¥     s    c         C   s   |  j  S(   N(   R×   (   RB   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyR¦     s    c         C   s   |  j  S(   N(   RØ   (   RB   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyR§     s    c         C   s   |  j  S(   N(   RÙ   (   RB   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyR¨     s    c         C   s   |  j  S(   N(   RÚ   (   RB   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyR©     s    c         C   s   |  j  S(   N(   Ré   (   RB   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyRë     s    c         C   s   |  j  S(   N(   Rí   (   RB   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyt   peak_list_indices  s    c         C   s   |  j  S(   N(   Rñ   (   RB   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyt   fixed_site_indices!  s    c         C   s   |  j  S(   N(   Rï   (   RB   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyt   sites$  s    c         C   s   |  j  S(   N(   Rð   (   RB   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyt   heights'  s    c         C   s*   |  j  j ƒ  d k r d  S|  j  j ƒ  d S(   Ni    (   Rù   RO   R&   Rý   (   RB   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyt   max_grid_height*  s    i    c         C   s{   |  j  d  k	 r% |  j  j d | ƒ n  |  j j |  j j ƒ  ƒ |  j j | ƒ |  j j | ƒ |  j j |  j	 j ƒ  ƒ d  S(   Nt   original_site(
   Ré   R&   t   insert_fixed_site_fracRñ   R!   Rï   RO   Rð   Rí   Rù   (   RB   Rá   Râ   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyt   append_fixed_site/  s    c         C   se   |  j  j ƒ  d k s t ‚ |  j d  k	 r: |  j j ƒ  n  |  j  j ƒ  |  j j ƒ  |  j j ƒ  d  S(   Ni    (	   Rí   RO   RR   Ré   R&   t   discard_lastt   pop_backRï   Rð   (   RB   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyR  7  s    c         C   s  x|  j  } | |  j j ƒ  k r% d  S|  j  d 7_  |  j j d |  j j ƒ  | ƒ } | j ƒ  } |  j j	 d | d | ƒ sƒ q n  |  j j
 ƒ  | } |  j j | ƒ |  j j | ƒ |  j j | ƒ t d | d |  j j | ƒ d |  j j ƒ  | d | d | ƒ Sd  S(	   Ni   Rá   Rÿ   t   site_symmetry_opsRÞ   Rß   Rà   Râ   (   Rî   Rù   RO   R&   Rê   t   site_symmetryRü   t
   exact_siteRé   t   process_site_fracRý   Rí   R!   Rï   Rð   RÝ   t   grid_indicest   grid_heights(   RB   RÞ   R  Rá   Râ   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyRó   ?  s,    	 	 c         C   sc   | d  k r |  j } n  | d  k	 s* t ‚ x2 |  j j ƒ  | k rF Pn  |  j ƒ  d  k r- Pq- q- |  S(   N(   R&   RÚ   RR   Rï   RO   Ró   (   RB   R©   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyRö   U  s      c         C   sF  x?|  j  } | |  j j ƒ  k r% d  S|  j  d 7_  |  j d  k	 rf |  j | rV q n  t |  j | <n  |  j j | ƒ } |  j j ƒ  | } |  j j ƒ  | } |  j j	 ƒ  | } |  j
 j | ƒ } |  j rß | j ƒ  rß q n  | j ƒ  } t j | ƒ } t } |  j j ƒ  d k r:d d  l }	 |	 j d d d t ƒ n  xB |  j D]7 }
 t j | |
 ƒ j ƒ  } | |  j k  rDt } PqDqDW| t k r |  j d  k	 rê|  j j ƒ  d k sÉ| |  j d |  j k  rê|  j | | | | ƒ \ } } n  |  j j | ƒ |  j j | ƒ |  j j | ƒ t d | d	 | d
 | d | d | ƒ Sq d  S(   Ni   iú   iÿÿÿÿt   messagesH   This function should not be used for processing a large number of peaks.t   categoryi    RÞ   Rß   Rà   Rá   Râ   (    Rî   Rù   RO   R&   Rç   R$   R  R	  Rü   Rý   Rê   R  RÕ   t   is_point_group_1R  R   t   sym_equiv_sitesRï   t   warningst   warnt   RuntimeWarningt   min_sym_equiv_distance_infot   distRÙ   RÜ   RÖ   Rð   R×   t   _accumulate_significantRí   R!   RÝ   (   RB   RÞ   Rß   Rà   Rá   Râ   R  t   equiv_sitest   keepR  R`   R  (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyRò   ^  s\    	  		
c         C   s­  |  j  ƒ  j ƒ  } | j } | j } t j | | ƒ ƒ | } | }	 | |  j }
 xFt |  j |  j	 j
 ƒ  ƒ D])} |  j | r… ql n  |  j	 j ƒ  | } | |
 k  r¨ Pn  |  j	 j ƒ  | } |  j j | ƒ } |  j rö | j ƒ  rö t |  j | <ql n  | j ƒ  } t j | | ƒ } | j ƒ  } | |  j k  rl t |  j | <| j t j | g ƒ ƒ d } | j ƒ  | } | t j | | ƒ ƒ | 7} |	 | 7}	 ql ql W| | |	 ƒ | f S(   Ni    (   R¢   R   t   orthogonalizet   fractionalizeR   t   colRØ   Rº   Rî   Rù   RO   Rç   Rý   Rü   Rê   R  RÕ   R  R$   R  R   R  R  RÙ   t   applyR   R    t
   special_op(   RB   Rá   Râ   R  R  R   t   ortht   fract   sum_w_sitest   sum_wt   height_cutoffR½   t   other_heightt
   other_sitet   other_site_symmetryt	   dist_infoR  t
   close_site(    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyR  �  s:    		"  			c         C   sc   | d  k r |  j } n  | d  k	 s* t ‚ x2 |  j j ƒ  | k rF Pn  |  j ƒ  d  k r- Pq- q- |  S(   N(   R&   RÚ   RR   Rï   RO   Rò   (   RB   R©   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyRõ   ª  s      N(   RC   RD   RÜ   R&   RA   Rô   R   Rø   Rk   R¢   R¤   R¥   R¦   R§   R¨   R©   Rë   Rú   Rû   Rü   Rý   Rþ   R  R  Ró   Rö   Rò   R  Rõ   (    (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyR´   Ç  s>    																				/	c   %      C   s€  |  j  | ƒ } | j ƒ  } | j ƒ  } | j ƒ  }	 d d l m }
 d d l m } m } |  j	 ƒ  } d d d g } d d d g } d d d g } d d d g } x!t
 d ƒ D]} | | |	 | } | | } | | | |	 | | ƒ } | | | |	 | | ƒ } | | d } |
 j d | d d	 ƒ | | <| | |	 | k  r‘| | | d
 } | | | | <| | | | | <| | |	 | | | <q® |	 | | | <d | | <| | | | <d | | <q® W|  j | ƒ } | | } d d l m } | j d t j d t | ƒ | d d d ƒ d | ƒ } | j d | ƒ | j d | ƒ j ƒ  } t d | j ƒ  d | j ƒ  d | ƒ } d d l m } | j d | d | ƒ }  |  j ƒ  |  j ƒ  }! t d | j ƒ  d | d | d | d | ƒ }" t d | d | d t j  | ƒ t j  | ƒ t j  d  ƒ ƒ }# |# j! ƒ  |! j! ƒ  k s<t" ‚ t# j$ d |! j% |" ƒ d |# j% |" ƒ ƒ }$ |$ j& ƒ  svd  S|$ j( ƒ  S(!   Niÿÿÿÿ(   t   fftpack(   t   ifloort   iceili    i   i   t   min_gridR†   i   i   (   t   xrayR(   R   t   space_group_symbolt   P1t
   scatterersR   R€   R„   Rˆ   (   t   millerRy   t   fourier_coefficientsR   R   R   Rs   Rt   Ru   t   xt   y(   i   i   i   ()   R  R%   RH   R   t   scitbxR%  t   libtbx.math_utilsR&  R'  Rµ   Rº   t   adjust_griddingR  t   cctbxR)  t	   structureR   R–   t   tuplet   set_sites_cartt   structure_factorst   f_calcRy   R   R„   R-  t   fft_mapRv   t   real_map_unpaddedR   R±   R   R  R   RR   R   t   linear_correlationR"   t   is_well_definedR&   t   coefficient(%   t   large_unit_cellt   large_d_mint   large_density_mapR   R   t   work_scattererst   sites_frac_larget   large_frac_mint   large_frac_maxt   large_n_realR%  R&  R'  t	   large_ucpt   small_n_realt   small_origin_in_large_gridt	   small_abct   sites_frac_shiftR½   t	   grid_stept   buffert   grid_mint   grid_maxR(  t	   shift_mint   sites_cart_shiftt   sites_cart_smallR)  t   small_xray_structuret   small_f_calct   small_griddingR-  t   small_fft_mapt	   small_mapR  t   small_copy_from_large_mapt   corr(    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyt   region_density_correlation³  s‚    


								
	,	i'  c   	      C   sï   | r? t  d |  d | ƒ j ƒ  }  t  d | d | ƒ j ƒ  } n  | d  k	 r½ |  | }  | | } |  d k  } | d k  } |  j | d ƒ }  | j | d ƒ } d „  } | d |  d | d | ƒ St j d |  j ƒ  d | j ƒ  d | ƒ j ƒ  Sd  S(	   NR   t   n_binsi    c         S   sn   |  d k } | d k } | | B} | j  ƒ  } |  j | ƒ } | j | ƒ } t j d | d | d | ƒ j ƒ  S(   Ni    R/  R0  t   subtract_mean(   t
   iselectionR"   R   R<  R>  (   R/  R0  t   centeredt   s1t   s2R`   t   x_t   y_(    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyRY  
  s    
R/  R0  R^  R\  (   t   volume_scaleR'   R&   t   set_selectedR   R<  RN   R>  (	   t   map_1t   map_2t   modifiedR^  R)   R[  R_  R`  RY  (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyt   ccvÿ  s    

		!t   spherical_variance_around_pointc           B   s)   e  Z d  e d d „ Z d d d „ Z RS(   i(   c         C   s  | |  _  | |  _ | d k s$ t ‚ g  } | \ }	 }
 } xö t d | d ƒ D]á } d d | d t | d ƒ } t j | ƒ } | d k sš | | k r£ d } n. | d t j | d | | ƒ d t j } | j	 |	 t j
 | ƒ t j
 | ƒ |
 t j | ƒ | t j | ƒ t j
 | ƒ f ƒ | } qM Wt j ƒ  } x< | D]4 } | j d | ƒ } | j | ƒ } | j	 | ƒ qEWt j | ƒ |  _ t j | ƒ |  _ t j | ƒ |  _ | j ƒ  |  _ | d  k	 rt | d ƒ } x+ t | ƒ D] \ } } | j d | ƒ qêW| j ƒ  n  d  S(	   Ni    i   iÿÿÿÿi   gÍÌÌÌÌÌ@t	   site_cartt   ws=   HETATM    1  O   HOH A   1     %7.3f %7.3f %7.3f  1.00 20.00
(   Rj  t   radiusRR   RÍ   t   floatt   matht   acost   sqrtt   piR!   t   sint   cosR   R   R  t   tricubic_interpolationR%   RH   RI   t    standard_deviation_of_the_sampleR0   R&   t   openRP   t   writet   close(   RB   t   real_mapR   Rj  Rl  t   n_pointst   spline_interpolationt   write_sphere_points_to_pdb_filet   sphere_pointsR/  R0  t   zRÌ   t   ht   thetat   phit   old_phiRY   t   pointt	   site_fract   value_at_pointRJ   R½   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyRA     s@    		 	.$
R
   c         C   sz   | d  k r t j } n  | d | |  j d |  j d |  j d |  j f IJ| d | |  j |  j |  j |  j f IJd  S(   Ns2   %sMap values around point [%g, %g, %g], radius=%g:i    i   i   s.   %s  min=%.2f  max=%.2f  mean=%.2f  stddev=%.2f(	   R&   RF   RG   Rj  Rl  R%   RH   RI   R0   (   RB   t   outRK   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyt   showF  s     !N(   RC   RD   R$   R&   RA   R‡  (    (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyRi    s   &c         C   s”  | d k s t  ‚ d d  l } d d l m } t d | d |  j ƒ  d |  j ƒ  d t j | g ƒ d t j	 | g ƒ ƒ } t
 |  j ƒ  | j ƒ  ƒ } t j ƒ  } t j	 ƒ  }	 | j d	 | ƒ }
 |  j |
 ƒ } | d k rñ t j |  j ƒ  ƒ } n  xl | D]d } | | |  j ƒ  ƒ } | | ƒ } | j | ƒ | j d	 | ƒ }
 |	 j t d
 |  | ƒ | ƒ qø Wt j |	 ƒ d k s{t  ‚ | j j d | d |	 ƒ S(   Ni    iÿÿÿÿ(   t   n_dim_index_from_one_dimR   R   R   R   R   Rj  g�íµ ÷Æ°>t   pointst   weights(   RR   t   scitbx.matht   libtbx.utilsRˆ  R   R   R   R   R    R   t	   grid2cartt   orthogonalization_matrixR  Rt  RH   RN   R!   Rn  t   principal_axes_of_inertia(   Ry  Rj  R   Rl  R1  Rˆ  R-   t   grid_to_cartRü   t   valuesR„  t   weight_scalet   i_seqt   uvwt   xyz(    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyR�  N  s6    "t   local_scalec           B   s   e  Z d d d d d  „ Z RS(   c      
   C   s  | | g j  d  ƒ d k s! t ‚ | d  k	 rm d d  l } | j j d | d | ƒ } | j ƒ  | j ƒ  } n  d  |  _ d  |  _	 t
 d | j ƒ  d d ƒ }	 t j t j |	 j ƒ ƒ |  _ x¾ t |	 j |	 j ƒ D]§ \ }
 } t | |
 | ƒ } | j t j | j ƒ  ƒ ƒ | j ƒ  j ƒ  j ƒ  \ } } } | | k  rSt d | d	 d
 ƒ j ƒ  } n  t d | d |  j d |
 d | ƒ qÎ W|  j j ƒ  } |  j | |  _ | d  k	 r| } | d  k	 r×| j ƒ  } | j d | ƒ } n  | j d |  j d t d t  d t  ƒ |  _	 n  d  S(   Ni   iÿÿÿÿRy   R.  R   RÄ   g¸…ëQ¸ž?R   R[  iè  t   map_data_fromt   map_data_tot   startt   endR€   t	   use_scalet   anomalous_flagt   use_sg(!   R#   R&   RR   t   cctbx.millerR-  R:  Rv   R;  t
   map_resultt   map_coefficientsR¹   R   R   R   R²   t   zipRÂ   RÃ   R±   t   reshapeR   RN   t   min_max_meant   as_tupleRc  R'   t   set_boxt   sample_standard_deviationR€   t   complete_sett   structure_factors_from_mapR$   RÜ   (   RB   Ry   R(   t   f_mapR'   t   miller_arrayR€   R4  R:  RÉ   R`   t   et   boxt   mit   mat   met   sdR§  (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyRA   q  sJ    	!	
			"!			N(   RC   RD   R&   RA   (    (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyR–  p  s   g{®Gáz„?c         C   sF  t  j ƒ  } t  j ƒ  } t | d ƒ d } t | d ƒ } xý t d | | ƒ D]é }	 |	 d }	 | j |	 ƒ t  j ƒ  }
 x§ t d d | ƒ D]“ } xŠ t d d | ƒ D]v } t j j d |	 d | d | d	 | ƒ \ } } } | j	 | | | g ƒ \ } } } |
 j |  j
 | | | g ƒ ƒ q¤ Wq‹ W| j t  j |
 ƒ ƒ qO W| | f S(
   Nid   i   i    g      Y@ih  R.   t   s_degt   t_degt   center(   R   R   RT   RÍ   R!   Rº   R1  Rn  t   point_on_sphereR  t   eight_point_interpolationRI   (   R'   R   t   center_cartRl  R‚   t   s_angle_sampling_stept   t_angle_sampling_stept   rho_1dR  R.   t   rhoR`   t   tt   xct   yct   zct   xft   yft   zf(    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyt   map_peak_3d_as_2d¢  s     
!'t+   positivity_constrained_density_modificationc           B   s)   e  Z d  d d d d d „ Z d „  Z RS(   id   g      Ð?c         C   s§  | |  _  | |  _ d  |  _ | |  _ d d l m } |  j d  k rX |  j  j ƒ  |  _ n  | d  k r |  j  j d |  j ƒ } n  |  j d  k rÍ |  j  j d | d | d d  d d  d d  d d	 d
 t ƒ |  _ n  |  j  j	 ƒ  |  _
 xÁ t | ƒ D]³ }	 | j d |  j d |  j
 d | ƒ }
 | d  k	 r/|
 j ƒ  n  |
 j ƒ  |  _ t |  j d ƒ | j d |  j d t d t d t ƒ |  _
 |  j  j d |  j
 d t d t ƒ |  _
 qì Wd  S(   Niÿÿÿÿ(   R-  R€   R�   RL  Rƒ   R…   R†   i   R‡   Ry   R.  t   f_000i    R   R›  Rœ  R�  R�   t   scalet   replace_phases(   RJ   R€   R&   R   Ry   R4  R-  R§  R$   t	   deep_copyt   f_modRº   R:  t   apply_volume_scalingR;  t   convert_to_non_negativeR¨  RÜ   t   complete_with(   RB   RJ   RÄ  t   n_cyclesR�   R€   Ry   R§  R-  R½   R:  (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyRA   ¼  sF    				 				 		c         C   su   d d l  m } |  j |  j } } | j | ƒ \ } } t | ƒ j ƒ  } t | ƒ j ƒ  } | | | ƒ sq t ‚ d  S(   Niÿÿÿÿ(   t   approx_equal(   t   libtbx.test_utilsRÍ  RJ   RÈ  t   common_setst   absRl   RR   (   RB   RÍ  R/  R0  (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyt   assert_equalá  s    N(   RC   RD   R&   RA   RÑ  (    (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyRÃ  »  s   	$(A   t
   __future__R    t   cctbx.sgtbxR4  t   boost.pythont   boostt   pythont
   import_extR   R   R   R   t   cctbx.array_familyR   R1  R   t   scitbx.python_utilsR   R¬   R   t   libtbx.load_envRn  RF   t   osR‹  t   environt   getRè   R   RT   R   Rµ  Rt  R$   R   R/   R6   R>   R4   t   injectorRE   t   search_symmetry_flagsRM   t	   histogramRk   Rr   t   easyt   structure_factors_to_mapR¨  R8  t   objectRy   Rš   R¹   R«   RÝ   R´   RZ  R&   Rh  Ri  R�  R–  RÂ  RÃ  (    (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/maptbx/__init__.pyt   <module>   sf   
			
	"			";		a+:B	ì	L6	"7