ó
ĝ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 beam model to a dictionary

  Params:
      beam The beam model

  Returns:
      A dictionary of the parameters

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

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

  Returns:
      The beam model

  i˙˙˙˙(   t   BeamN(   t   dxtbx.modelR   R   t	   from_dictt   dictt   items(   t   dt   tR   (    (    sB   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/dxtbx/serialize/beam.pyR      s     N(   t
   __future__R    R   R   R   (    (    (    sB   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/dxtbx/serialize/beam.pyt   <module>   s   	