ó
ü™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	   FormatSMVt   FormatSMVRigakuc           B   sJ   e  Z d  Z e d „  ƒ Z d „  Z d „  Z d „  Z d „  Z d „  Z	 RS(   s?   A class for reading SMV format Rigaku images. 'Abstract' class.c         C   sµ   t  j |  ƒ \ } } d d d d d d d g } x | D] } | | k r7 t Sq7 W| d j ƒ  } y t | d j ƒ  ƒ } Wn t t t f k
 rš } t SX| t	 | ƒ k r± t St
 S(   s³   Check to see if this looks like a Rigaku d*TREK SMV format image,
    i.e. we can make sense of it. Essentially that will be if it contains
    all of the keys we are looking for.t   DETECTOR_NUMBERt   DETECTOR_NAMESt
   BYTE_ORDERt   DIMt   SIZE1t   SIZE2t	   Data_type(   R   t   get_smv_headert   Falset   splitt   intt   stript   KeyErrort   AttributeErrort
   ValueErrort   lent   True(   t
   image_filet   sizet   headert   wanted_header_itemst   header_itemt   detector_prefixest   detector_numbert   e(    (    sJ   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/dxtbx/format/FormatSMVRigaku.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   (    (    sJ   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/dxtbx/format/FormatSMVRigaku.pyR   .   s    c         C   s   t  d ‚ d S(   sh   Overload this method to read the image file however you like so
    long as the result is an goniometer.s   overload meN(   t   RuntimeError(   R   (    (    sJ   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/dxtbx/format/FormatSMVRigaku.pyt   _goniometer6   s    c         C   s   t  d ‚ d S(   sf   Overload this method to read the image file however you like so
    long as the result is an detector.s   overload meN(   R    (   R   (    (    sJ   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/dxtbx/format/FormatSMVRigaku.pyt	   _detector<   s    c         C   s   t  d ‚ d S(   sb   Overload this method to read the image file however you like so
    long as the result is an beam.s   overload meN(   R    (   R   (    (    sJ   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/dxtbx/format/FormatSMVRigaku.pyt   _beamB   s    c         C   s   t  d ‚ d S(   sb   Overload this method to read the image file however you like so
    long as the result is an scan.s   overload meN(   R    (   R   (    (    sJ   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/dxtbx/format/FormatSMVRigaku.pyt   _scanH   s    (
   t   __name__t
   __module__t   __doc__t   staticmethodR   R   R!   R"   R#   R$   (    (    (    sJ   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/dxtbx/format/FormatSMVRigaku.pyR      s   				t   __main__Ni   (
   t
   __future__R    t   dxtbx.format.FormatSMVR   R   R%   t   syst   argvt   argR   (    (    (    sJ   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/dxtbx/format/FormatSMVRigaku.pyt   <module>   s   ?