ó
 š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   FormatSMVADSCSNt   FormatSMVADSCSN445c           B   s/   e  Z d  Z e d „  ƒ Z d „  Z d „  Z RS(   s‰   A class for reading SMV format ADSC images, and correctly constructing
  a model for the experiment from this, for instrument number 445.c         C   s3   t  j |  ƒ \ } } t | d ƒ d k r/ t St S(   s$   Check to see if this is ADSC SN 445.t   DETECTOR_SNi½  (   R   t   get_smv_headert   intt   Falset   True(   t
   image_filet   sizet   header(    (    sM   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/dxtbx/format/FormatSMVADSCSN445.pyt
   understand   s    c         C   s)   |  j  | ƒ s t ‚ t j |  | ƒ d S(   sc   Initialise the image structure from the given file, including a
    proper model of the experiment.N(   R   t   AssertionErrorR   t   __init__(   t   selfR   (    (    sM   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/dxtbx/format/FormatSMVADSCSN445.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   DENZO_XBEAMt   DENZO_YBEAMt
   PIXEL_SIZEt   SIZE1t   SIZE2iÿÿ  i   t   CCDs   +xs   -y(   t   floatt   _header_dictionaryt   _detector_factoryt   simple(   R   t   distancet   beam_xt   beam_yt
   pixel_sizet
   image_sizet   overloadt	   underload(    (    sM   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/dxtbx/format/FormatSMVADSCSN445.pyt	   _detector+   s    	(   t   __name__t
   __module__t   __doc__t   staticmethodR   R   R!   (    (    (    sM   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/dxtbx/format/FormatSMVADSCSN445.pyR      s   	
t   __main__Ni   (   t
   __future__R    t   dxtbx.format.FormatSMVADSCSNR   R   R"   t   syst   argvt   argt   FormatSMVADSCR   (    (    (    sM   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/dxtbx/format/FormatSMVADSCSN445.pyt   <module>   s   -