ó
Ž™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 Z d d „ Z	 d S(   iÿÿÿÿ(   t   division(   t   random_structure(   t   miller(   t   flexNi    c   
   
   C   sM  | r |  j  ƒ  j ƒ  r d  St j |  d d g | d d d d d t ƒ} d sV | ri | j ƒ  j ƒ  n  | j d	 | d
 | ƒ j	 ƒ  } t
 j d | d | j ƒ  t j t j | j ƒ  ƒ ƒ ƒ } | j ƒ  rIt j | j ƒ  j ƒ  t ƒ } xI t | j ƒ  j ƒ  d ƒ D]+ } t j | j ƒ  j ƒ  ƒ }	 t | |	 <qW| j | ƒ } n  | S(   Nt   elementst   constt   volume_per_atomiô  t   min_distanceg       @t   general_positions_onlyi    t   d_mint   anomalous_flagt
   miller_sett   datai
   (   t   groupt
   is_centrict   NoneR   t   xray_structuret   Truet   show_summaryt   show_scattererst   structure_factorst   f_calcR   t   arrayR   R   t   meant   absR
   t   boolt   indicest   sizet   xranget   randomt	   randranget   Falset   select(
   t   space_group_infot   n_scatterersR	   R
   t   verboset	   structureR   t	   selectiont   it   j(    (    sD   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/regression/utils.pyt   random_f_calc   s,    			+#(
   t
   __future__R    t   cctbx.developmentR   t   cctbxR   t   cctbx.array_familyR   R   R(   (    (    (    sD   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/regression/utils.pyt   <module>   s
   