ó
þ™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   FormatSMVADSCSN926c           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 926.c         C   s3   t  j |  ƒ \ } } t | d ƒ d k r/ t St S(   s$   Check to see if this is ADSC SN 926.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/FormatSMVADSCSN926.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/FormatSMVADSCSN926.pyR   "   s    c   
      C   sÿ   d d l  } t |  j d ƒ } t |  j d ƒ } t |  j d ƒ } t |  j d ƒ } t |  j d ƒ t |  j d ƒ f } t |  j d	 ƒ } d
 } d }	 | | | j | | j d ƒ 7} |  j j d | | | f d d d | | | f | |	 | f g  ƒ S(   s¬   Return a model for a simple detector, allowing for the installation
    on on a two-theta stage. Assert that the beam centre is provided in
    the Mosflm coordinate frame.iÿÿÿÿNt   DISTANCEt   BEAM_CENTER_Xt   BEAM_CENTER_Yt
   PIXEL_SIZEt   SIZE1t   SIZE2t   TWOTHETAiÿÿ  i    g     €f@t   CCDs   +xs   -y(   t   matht   floatt   _header_dictionaryt   tant   pit   _detector_factoryt	   two_theta(
   R   R   t   distancet   beam_xt   beam_yt
   pixel_sizet
   image_sizeR   t   overloadt	   underload(    (    sM   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/dxtbx/format/FormatSMVADSCSN926.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/FormatSMVADSCSN926.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/FormatSMVADSCSN926.pyt   <module>   s   6