ó
.™xTc           @   sZ   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   manager(   t   from_scatterers_direct(   t   from_scatterers_fftt   from_scatterersc           B   s   e  Z d  Z d d „ Z RS(   s0    Factory class for structure factor evaluations c      	   C   sõ   | d	 k s t ‚ | d k r» | j ƒ  j ƒ  } | j ƒ  j ƒ  } |  j ƒ  sŠ d | |  j ƒ  j ƒ  | |  j ƒ  j	 ƒ  k  r¸ d } q¸ q» |  j
 | | ƒ |  j | | ƒ k r» d } q» n  | d k rÐ t } n t } | d |  d | d | d | ƒ S(
   s¡  Evaluate structure factors and return the result

    :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 algorithm: string
    :param algorithm: the name of the evaluation method, either "direct", "fft", or None

    :rtype: an instance of
      `cctbx.xray.structure_factors.from_scatterers_direct` or
      `cctbx.xray.structure_factors.from_scatterers_fft`
    :retruns: an instance e of
      `cctbx.xray.structure_factors.from_scatterers_direct` or
      `cctbx.xray.structure_factors.from_scatterers_fft`
      when C{algorithm} is respectively equal to "direct" or "fft",
      or the best suited of the two of them when C{algorithm} is None
      providing the evaluated structure factors as C{e.f_calc()}
    t   directt   ffti   R   t   xray_structuret
   miller_sett	   algorithmN(   R   R   N(   t   Nonet   AssertionErrort
   scattererst   sizet   indicest   have_good_timing_estimatest   space_groupt   order_pt   crystal_griddingt   n_grid_pointst   estimate_time_directt   estimate_time_fftR   R   (   t   selfR   R   R	   t   n_scattererst   n_miller_indicest   f(    (    sZ   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/xray/structure_factors/from_scatterers.pyt   __call__   s&     	N(   t   __name__t
   __module__t   __doc__R
   R   (    (    (    sZ   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/xray/structure_factors/from_scatterers.pyR   	   s   N(	   t
   __future__R    t$   cctbx.xray.structure_factors.managerR   t3   cctbx.xray.structure_factors.from_scatterers_directR   t0   cctbx.xray.structure_factors.from_scatterers_fftR   R   (    (    (    sZ   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/xray/structure_factors/from_scatterers.pyt   <module>   s   