ó
û™xTc           @   s{   d  d l  m Z d  d l m Z d e f d „  ƒ  YZ e d k rw d  d l Z x& e j d D] Z e j	 e ƒ GHq\ Wn  d S(   iÿÿÿÿ(   t   division(   t   FormatSMVADSCt   FormatSMVADSCDBGc           B   s/   e  Z d  Z e d „  ƒ Z d „  Z d „  Z RS(   sC    Format class for reading images converted from pilatus to smv adscc         C   sI   t  j |  ƒ \ } } t | d ƒ d k rE t | d ƒ d k rE t St S(   s<   Check to see if this has the correct dimensions of a pilatust   SIZE1iŸ	  t   SIZE2iß	  (   R   t   get_smv_headert   intt   Truet   False(   t
   image_filet   sizet   header(    (    sK   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/dxtbx/format/FormatSMVADSCDBG.pyt
   understand   s    ,c         C   sz   t  j |  ƒ d |  j d <d |  j d <d d l m } | |  j ƒ |  _ |  j j ƒ  d |  j j d <d |  j j d <d  S(	   Nt   2527R   t   2463R   iÿÿÿÿ(   t   SMVImageiß	  iŸ	  (	   R   t   _startt   _header_dictionaryt   iotbx.detectorsR   t   _image_filet   detectorbaset
   readHeadert
   parameters(   t   selfR   (    (    sK   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/dxtbx/format/FormatSMVADSCDBG.pyR      s    c      
   C   s¸   t  |  j d ƒ } t  |  j d ƒ } t  |  j d ƒ } t  |  j d ƒ } t  |  j d ƒ t  |  j d ƒ f } d } d } |  j j d	 | | | f d
 d | | f | | | f g  ƒ	 S(   s­   Return a model for a simple detector, presuming no one has
    one of these on a two-theta stage. Assert that the beam centre is
    provided in the Mosflm coordinate frame.t   DISTANCEt   BEAM_CENTER_Xt   BEAM_CENTER_Yt
   PIXEL_SIZER   R   iÿÿ  i    t   CCDs   +xs   -y(   t   floatR   t   _detector_factoryt   simple(   R   t   distancet   beam_xt   beam_yt
   pixel_sizet
   image_sizet   overloadt	   underload(    (    sK   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/dxtbx/format/FormatSMVADSCDBG.pyt	   _detector)   s    	(   t   __name__t
   __module__t   __doc__t   staticmethodR   R   R'   (    (    (    sK   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/dxtbx/format/FormatSMVADSCDBG.pyR      s   	t   __main__Ni   (
   t
   __future__R    t   dxtbx.format.FormatSMVADSCR   R   R(   t   syst   argvt   argR   (    (    (    sK   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/dxtbx/format/FormatSMVADSCDBG.pyt   <module>   s   -