ó
 š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   FormatSMVADSCNoDateStampt   FormatSMVADSCSN457c           B   s8   e  Z d  Z e d „  ƒ Z 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 457.c         C   s3   t  j |  ƒ \ } } t | d ƒ d k r/ t St S(   s$   Check to see if this is ADSC SN 457.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/FormatSMVADSCSN457.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/FormatSMVADSCSN457.pyR   !   s    c         C   s   |  j  j ƒ  S(   sq   Return a model for a simple single-axis goniometer. This should
    probably be checked against the image header.(   t   _goniometer_factoryt   single_axis_reverse(   R   (    (    sM   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/dxtbx/format/FormatSMVADSCSN457.pyt   _goniometer+   s    c         C   ss   |  j  j d ƒ } t |  j d ƒ } d } t |  j d ƒ } t |  j d ƒ } |  j  j |  j | | | | | ƒ S(   sV   Return the scan information for this image. There may be
    no timestamps in there...t   SMVt   TIMEi    t	   OSC_STARTt	   OSC_RANGE(   t   _scan_factoryt   formatt   floatt   _header_dictionaryt   singlet   _image_file(   R   R   t   exposure_timet   epocht	   osc_startt	   osc_range(    (    sM   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/dxtbx/format/FormatSMVADSCSN457.pyt   _scan1   s    	(   t   __name__t
   __module__t   __doc__t   staticmethodR   R   R   R    (    (    (    sM   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/dxtbx/format/FormatSMVADSCSN457.pyR      s
   	
	t   __main__Ni   (   t
   __future__R    t%   dxtbx.format.FormatSMVADSCNoDateStampR   R   R!   t   syst   argvt   argt   FormatSMVADSCR   (    (    (    sM   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/dxtbx/format/FormatSMVADSCSN457.pyt   <module>   s   /