ó
ƒ™xTc           @   s‰   d  Z  d d l m Z d d l Z d d l Z d d l m Z m Z d d l	 Z
 d d l Z d „  Z e d k r… e e j d ƒ n  d S(   s2   input pdb -> structure factors -> x-plor map filesiÿÿÿÿ(   t   divisionN(   t   ifloort   iceilc         C   sÀ  t  |  ƒ d k r d g }  n  t j j d d ƒ j d  d d d d d	 d
 d d d ƒj d |  ƒ } | j j } | d k s� t ‚ x8| j	 D]-} t
 j j d | ƒ } | j ƒ  } | j ƒ  Hd G| GH| j d | ƒ j ƒ  } | j ƒ  H| j ƒ  } | j ƒ  } d G| GH| j d d ƒ Ht g  | D] }	 t |	 d ƒ ^ q%ƒ }
 t g  t |
 | ƒ D]) \ } }	 t | d t |	 d ƒ ƒ ^ qWƒ } d G|
 GHd G| GH| j d d d |
 d | ƒ Hq‹ Wd  S(   Ni    s   --helpt   usages7   iotbx.python pdb_to_map_simple.py [options] pdb_file...s   --d_mint   typet   floatt   defaulti   t   helps6   high-resolution limit for structure-factor calculationt   metavart   FLOATt   argst	   file_names   d_min:t   d_mins   unit cell gridding:s   unit_cell.mapgš™™™™™É?i
   gffffffæ?s   block first:s   block last: s	   block.mapt   gridding_firstt   gridding_last(   t   lent   libtbxt   option_parsert   optiont   Nonet   processt   optionsR   t   AssertionErrorR
   t   iotbxt   pdbt   inputt   xray_structure_simplet   show_summaryt   structure_factorst   f_calct   fft_mapt   n_realt   as_xplor_mapt   tupleR   t   zipt   maxR   (   R
   t   command_lineR   R   t   pdb_inpt   xray_structureR   R   t   nt   it   block_firstt   ft
   block_last(    (    sN   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/examples/pdb_to_map_simple.pyt   run
   sF     			
	
	)E			t   __main__i   (   t   __doc__t
   __future__R    t	   iotbx.pdbR   t   iotbx.xplor.mapt   libtbx.math_utilsR   R   t   libtbx.option_parserR   t   sysR,   t   __name__t   argv(    (    (    sN   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/examples/pdb_to_map_simple.pyt   <module>   s   	$