ó
łxTc           @   s)   d  d l  m Z d   Z d d  Z d S(   i’’’’(   t   divisionc         C   s   |  d k r d S|  j   S(   s    Convert the scan model to a dictionary

  Params:
      scan The scan model

  Returns:
      A dictionary of the parameters

  N(   t   Nonet   to_dict(   t   scan(    (    sB   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/dxtbx/serialize/scan.pyR      s    
c         C   s«   d d l  m } d d l m } |  d k rL | d k r< d St | d  Sn+ | d k rw t | j   |  j    }  n  t |  d t	  s |  d g |  d <n  | j |   S(   s£    Convert the dictionary to a scan model

  Params:
      d The dictionary of parameters
      t The template dictionary to use

  Returns:
      The scan model

  i’’’’(   t   Scan(   t   flext   exposure_timeN(
   t   dxtbx.modelR   t   scitbx.array_familyR   R   t	   from_dictt   dictt   itemst
   isinstancet   list(   t   dt   tR   R   (    (    sB   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/dxtbx/serialize/scan.pyR	      s     N(   t
   __future__R    R   R   R	   (    (    (    sB   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/dxtbx/serialize/scan.pyt   <module>   s   	