ó
 xTc           @   so   d  d l  m Z d  d l Z d   Z d   Z e d k rk e   e j d Z e j d 3e e e    n  d S(   i˙˙˙˙(   t   divisionNc       	   C   s;  d }  x.t  d d  D]} x t  d d  D]{ } t d t |  t |   } t | | |  t t |  t |   } | Gt | |  } | GH|  d | | f 7}  q, W|  GH|  d 7}  xD t  d d d	  D]0 } |  d | t t d d | f d
  f 7}  qÍ Wt d d  } | j	 |   | j
   d s t  q Wd  S(   Nt    iZ   ix   iL˙˙˙iľ   t   Gly_nonxpros    %f %f
s   
i
   i   s   junk.datt   wbi    (   t   ranget   get_grid_valuest   floatt
   print_gridt	   get_indext   interpolate_2dt   get_db_resultt   cdl_databaset   filet   writet   closet   AssertionError(   t   outlt   it   jt   gridt   indext   rt   f(    (    se   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/conformation_dependent_library/test_interpolation.pyt   run   s&    
	%
c          C   sĺ   d d d d g d d d d g d	 d d
 d g d d d d g g }  |  GHd d d d
 g } d } x t  d  D]q } xh t  d  D]Z } t |  | | f  } | G| G| G| | GHt | | |  d k  sĎ t  | d 7} q Wql Wd  S(   Ngš?gń?gÍĚĚĚĚĚ @g333333ó?gÉ?g@gffffff@g      ř?gffffffö?gÍĚĚĚĚĚ@gů?g333333ű?i   i   i    g{ŽGáz?i   (   R   R	   t   absR   (   t   valuest   answersR   t   xt   yR   (    (    se   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/conformation_dependent_library/test_interpolation.pyt   exercise   s     t   __main__i   (	   t
   __future__R    t   sysR   R   t   __name__t   argvt   argst   tuple(    (    (    se   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/conformation_dependent_library/test_interpolation.pyt   <module>   s   		
