ó
-™xTc           @   sŠ   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	 m
 Z
 d  d l m Z d e f d	 „  ƒ  YZ d
 S(   iÿÿÿÿ(   t   division(   t   managed_calculation_base(   t   default_cos_sin_table(   t   global_counters(   t   ext(   t   miller(   t   user_plus_sys_timet   from_scatterers_directc           B   s#   e  Z d e d  d „ Z d „  Z RS(   t   directc   	      C   s©  t  ƒ  } t j |  | | | d d ƒt | d ƒ rU d d l m } | |  | ƒ d St  ƒ  } | d k	 ry | j ƒ  } n  | t k rŽ t	 } n | t
 k r£ d } n  | d k rý t j |  j j ƒ  |  j j ƒ  |  j j ƒ  |  j j ƒ  |  j j ƒ  ƒ |  _ nN t j | |  j j ƒ  |  j j ƒ  |  j j ƒ  |  j j ƒ  |  j j ƒ  ƒ |  _ | d k	 r�| j j | j ƒ  j ƒ  | j ƒ  j ƒ  | j ƒ  ƒ n  t j j | j ƒ  ƒ d S(   sØ  Evaluate structure factors via direct calculations

    :type xray_structure: cctbx.xray.structure
    :param xray_structure: the X-ray structure to evaluate the structure factors of
    :type miller_set: cctbx.miller.set
    :param miller_set: the set of miller indices to evaluate the structure factors at
    :type manager: cctbx.xray.structure_factors.manager
    :param manager: ? (TODO: doc)
    :type algorithm: string
    :param algorithm: the name of the evaluation method, either     "direct", "use_alt_parallel"
    :type cos_sin_table: boolean
    :param cos_sin_table: If set to 'True' a precalculated cos_sin_table is used     instead of actual trigonometric functions. Using a manager overrides this     setting with the one specified in the manager.

    :rtype: cctbx.xray.structure_factors.from_scatterers_direct
    :retruns: an instance `e` of `cctbx.xray.structure_factors.from_scatterers_direct`     providing the evaluated structure factors as `e.f_calc()`
    t	   algorithmR   t   use_alt_paralleliÿÿÿÿ(   t   pprocessN(   R   R   t   __init__t   hasattrt<   cctbx.xray.structure_factors.from_scatterers_direct_parallelR   t   Nonet   cos_sin_tablet   TrueR   t   FalseR   t   structure_factors_directt   _miller_sett	   unit_cellt   space_groupt   indicest   _xray_structuret
   scattererst   scattering_type_registryt   _resultst   estimate_time_directt   registert   sizet   elapsedR   R   t   process(	   t   selft   xray_structuret
   miller_sett   managerR   R	   t   time_allR   t   timer(    (    sa   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/xray/structure_factors/from_scatterers_direct.pyR      sB    						c         C   s   t  j |  j |  j j ƒ  ƒ S(   N(   R   t   arrayR   R   t   f_calc(   R!   (    (    sa   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/xray/structure_factors/from_scatterers_direct.pyR(   I   s    N(   t   __name__t
   __module__R   R   R   R(   (    (    (    sa   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/xray/structure_factors/from_scatterers_direct.pyR   
   s   9N(   t
   __future__R    t$   cctbx.xray.structure_factors.managerR   R   t   cctbx.xray.structure_factorsR   t
   cctbx.xrayR   t   cctbxR   t   libtbx.utilsR   R   (    (    (    sa   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/xray/structure_factors/from_scatterers_direct.pyt   <module>   s   