ó
�™xTc        
   @   sz   d  d l  m Z d  d l m Z d  d l m Z m Z d  d l m Z d Z	 d Z
 e d d d d d d d e d „	 Z d S(	   iÿÿÿÿ(   t   division(   t   flex(   t   wavelengthst   tiny_pse(   t   adptbxsR   If the structure is centrosymmetric, the origin MUST lie on a center of
symmetry.
sa   ShelX supports only the specification either of u_iso or of u_aniso,
each one excluding the otherc
   +   	   c   s9  |  j  ƒ  }
 |
 j ƒ  s1 |
 j ƒ  s1 t t ƒ ‚ | | g j d  ƒ d+ k sR t ‚ | d  k rg d } n  | d  k r‹ t j d ƒ j	 ƒ  } n  |  j
 ƒ  } |  j ƒ  } d | | j ƒ  j ƒ  f Vd | d j d- d/ ƒ | j ƒ  f Vd | j ƒ  j ƒ  Vd d j | j ƒ  j ƒ  ƒ } |
 j ƒ  s.| } n  d | VxG t |
 j ƒ  ƒ D]3 } |
 d d | ƒ } | j ƒ  rtqJn  d | VqJWd V|  j ƒ  } x  | D] } d | | | | <q™Wg  } g  } d0 } x; | D]3 } | | k rÎ| j | ƒ | j | | ƒ qÎqÎWg  | D]! } t j | ƒ j ƒ  | f ^ q} | j ƒ  g  | D] } | d ^ qD} x; | D]3 } | | k ra| j | ƒ | j | | ƒ qaqaWd d j | ƒ Vx | D] } d | Vq±Wd d j | ƒ Vt g  t | ƒ D] \ } } | | d f ^ qæƒ } d V| r"d | Vn  | r4d | Vn  | rFd | Vn  d V| d  k	 r¨t | t  ƒ rrd | Vq¨| \ } } | d  k r–d | Vq¨d | | f Vn  | d  k	 rÀd | Vn  d1 d3 d4 } d j | d5 ƒ } d j | d7 d8 d: ƒ } |	 rrg  |  j! ƒ  D]$ } t j | j" ƒ j ƒ  | f ^ q} | j d' t# ƒ t$ j% g  | D] } | d ^ qVƒ } n |  j! ƒ  } t& ƒ  }  x�| D]…} | j' d k s©t ‚ | j( d k s¾t ‚ | j) j* ƒ  | j) j+ ƒ  Asæt t, ƒ ‚ | j- j. ƒ  }! t/ |! ƒ d k st ‚ t/ |! ƒ d& k s%t ‚ |! |  k rDt0 d( |! ƒ ‚ n  |  j1 |! ƒ |! | | j" f | j2 }" | j3 ƒ  }# | j) j4 ƒ  s“|# d) 7}# n  |" |# f 7}" | j) j* ƒ  rÉ| |" | j5 f d VqŽt6 j7 | | j8 ƒ \ }$ }% }& }' }( }) | |" |$ |% |& |) |( |' f d VqŽW| r&d& }* n d	 }* d* |* Vd  S(;   Ni    i   s   ????t   Mos   TITL %s in %s
s   CELL %.5f %s
t    s   %.4f i   s   %.3fs   ZERR %i 0. 0. 0. 0. 0. 0.
t   PIRFABCs   LATT %i
s   SYMM %s
s   
s   %.1ft   Ct   Hiÿÿÿÿs   SFAC %s
s   DISP %s 0 0 0
s   UNIT %s
s
   TEMP %.0f
s   L.S. %i
s   CGLS %i
s   WGHT %s
s
   WGHT %.6f
s   WGHT %.6f %.6f
s
   FVAR %.8f
s   %-4ss   %2is   %11.6fs   %11.5fs   %10.5fs   %.5fi   s   =
 i   t   reverses   Duplicate atom name: "%s"i
   s   HKLF %i
(   i    i   (   s   %.4f (   s   %.4f s   %.4f s   %.4f (   s   %.3f(   s   %.3fs   %.3fs   %.3f(   R   R	   (   s   %-4ss   %2i(   s   %11.6f(   s   %11.6fs   %11.6fs   %11.6f(   s   %11.5f(   s   %10.5f(   s   %.5f(   s   %.5fs   %.5f(   s   =
 (   s   %.5f(   s   %.5fs   %.5fs   %.5fs   %.5f(9   t   space_groupt
   is_centrict   is_origin_centrict   AssertionErrort)   centric_implies_centrosymmetric_error_msgt   countt   NoneR   t   characteristict   as_angstromt   space_group_infot	   unit_cellt   typet   lookup_symbolt   joint
   parameterst   groupt   order_zt   findt!   conventional_centring_type_symbolt   xranget   n_smxt
   is_unit_mxt   unit_cell_contentt   appendR   t   tablet   atomic_numbert   sortt   dictt	   enumeratet
   isinstancet   strt
   scattererst   scattering_typet   TrueR   t   xray_scatterert   sett   fpt   fdpt   flagst	   use_u_isot   use_u_anisot#   both_iso_and_aniso_in_use_error_msgt   labelt   stript   lent   RuntimeErrort   addt   sitet   weightt   grad_occupancyt   u_isoR   t   u_star_as_u_cift   u_star(+   t   xray_structuret   data_are_intensitiest   titlet
   wavelengtht   temperaturet    full_matrix_least_squares_cyclest'   conjugate_gradient_least_squares_cyclest   overall_scale_factort   weighting_scheme_paramst   sort_scatterersR   t   sgit   uct   lattt   it   rt_mxt
   uc_contentt   et   sfact   unitt   priort   dsut   itemt   sortedt   sf_idxt   at   bt   fmt_tmplt   fmt_isot	   fmt_anisot   scR*   t   atomname_sett   atomnamet   paramst   occt   u11t   u22t   u33t   u12t   u13t   u23t   hklf(    (    s@   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/shelx/writer.pyt	   generator   sÆ    		  
	 .
54)		 '' 	N(   t
   __future__R    t   cctbx.array_familyR   t   cctbx.eltbxR   R   t   cctbxR   R   R4   R,   R   Ri   (    (    (    s@   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/shelx/writer.pyt   <module>   s   