ó
óxTc           @   s^   d  d l  m Z d   Z e d k rZ d  d l Z d  d l Z e e j e j d   n  d S(   i˙˙˙˙(   t   divisionc         C   s8  d d l  } d d l m } |  j   } |  j   } t t | j    \ } } | j   \ } } | j	 | j
    }	 | j	 | j    }
 | j	 | j    } d | j	 | j    } xx d	 D]p } xg d
 D]_ } | | | |	 | | | |
 | } d | j |  } d | j   d | j |  GHqÍ WqŔ Wd S(   sT   Compute the resolution limit corresponding to the corners of the detector
  surface.i˙˙˙˙N(   t   matrixi    i   g      ŕ?s   %.3fi   (   i    i   (   i    i   (   t   matht   scitbxR   t   get_detectort   get_beamt   mapt   intt   get_image_sizet   get_pixel_sizet   colt   get_fast_axist   get_slow_axist
   get_origint   get_directiont   anglet   get_wavelengtht   sin(   t   frameR   R   t   detectort   beamt   nfastt   nslowt   dfastt   dslowt   Ft   St   origint   s0t   dst   dft   cornert   theta(    (    sN   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/dxtbx/example/resolution_corners.pyt   resolution_corners   s    &t   __main__Ni   (   t
   __future__R    R!   t   __name__t   syst   dxtbxt   loadt   argv(    (    (    sN   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/dxtbx/example/resolution_corners.pyt   <module>   s
   	