ó
s™xTc           @   s�   d  Z  d d l m Z d d l m Z m Z d d l m Z d d l Z d d l	 Z	 d d l
 Z
 d „  Z e d k r‰ e e	 j d ƒ n  d S(	   sü  scitbx_rigid_body_essence
=========================

- A subset of ``scitbx/rigid_body/essence`` that can be used in isolation.

- Plain Python code for rigid body dynamics and gradient-driven minimization.

- Main reference::

    Rigid Body Dynamics Algorithms.
    Roy Featherstone,
    Springer, New York, 2007.
    ISBN-10: 0387743146

- `Open Source License <http://cctbx.svn.sourceforge.net/viewvc/cctbx/trunk/cctbx/LICENSE_2_0.txt?view=markup>`_

Context
-------

``scitbx/rigid_body/essence`` grew out of the development of the
dynamics engine for the ``phenix.refine`` **torsion angle dynamics**
module, which is used as a complementary method to gradient-driven
minimization, as a way to escape from local minima. See also:

  - Rice & Brunger (1994). Proteins: Structure, Function, and Genetics 19, 277-290.

  - http://phenix-online.org/

Nomenclature
------------

The variable names in the ``scitbx/rigid_body/essence`` source code
follow the nomenclature used in Featherstone's *Rigid Body Dynamics
Algorithms* as much as possible. Numerous ``RBDA`` comments point to
equations, tables, and figures in the book. **When using the source
code, it will be essential to have the book available as an introduction
and reference.**

Details
-------

Files::

  featherstone.py:   dynamics algorithms, based on Roy Featherstone's Matlab library
  spatial_lib.py:    spatial algebra, also based on Roy Featherstone's library
  joint_lib.py:      some joint models
  body_lib.py:       corresponding body objects
  scitbx_matrix.py:  general matrix algorithm (copy of scitbx/matrix/__init__.py)
  tst_basic.py:      unit tests compatible with Python 2.2 or higher

Download all files at once:

  - http://cctbx.sourceforge.net/scitbx_rigid_body_essence.tgz
  - http://cctbx.sourceforge.net/scitbx_rigid_body_essence.zip

To run the unit tests::

  cd scitbx_rigid_body_essence
  python tst_basic.py

The full scitbx/rigid_body functionality requires compiled modules,
written in C++. Download the entire scitbx from here:

  - http://cci.lbl.gov/scitbx_bundles/current/

or the entire cctbx (of which scitbx is a subset) from here:

  - http://cci.lbl.gov/cctbx_build/

Follow the instructions on the latter page to install the cctbx or
scitbx bundles (e.g. ``perl scitbx_bundle.selfx``).

The cctbx source tree is hosted at SourceForge. The latest versions
of the files in scitbx_rigid_body_essence can be found here:

  - http://cctbx.svn.sourceforge.net/viewvc/cctbx/trunk/scitbx/rigid_body/essence/

A version of featherstone.py that's closer to Roy Featherstone's original
Matlab code can be found here:

  - http://cctbx.svn.sourceforge.net/viewvc/cctbx/trunk/scitbx/rigid_body/proto/

The file ``wx_tardy.py`` is a simple 3D graphical viewer displaying
trajectories. It requires ``wxPython`` and the ``gltbx`` module of
the cctbx project. An easy way to get everything in one file and
install with a single command, is to download the phenix package from:

  - http://phenix-online.org/

Send questions to: cctbx@cci.lbl.gov or cctbxbb@phenix-online.org
iÿÿÿÿ(   t   division(   t	   copy_filet   remove_files(   t   easy_runNc            s¶  t  |  ƒ d k s t ‚ d } t j j | ƒ s@ t j | ƒ n  t j | ƒ t j j	 d d ƒ ‰  d ‡  f d † } | d d ƒ | d	 ƒ | d
 ƒ | d ƒ | d ƒ | d ƒ t
 d d ƒ j t ƒ t j d ƒ t j d k sû t j j d d ƒ rÿ d  St d ƒ t d ƒ t j d d ƒ j ƒ  t j j d ƒ sAt ‚ t j d d ƒ j ƒ  t j j d ƒ sot ‚ t j d ƒ t j d d ƒ j ƒ  t d ƒ t
 d d ƒ j d ƒ Jd  S(   Ni    t   scitbx_rigid_body_essencet   module_namet   scitbxt   .c            s    t  t j j ˆ  |  ƒ | ƒ d  S(   N(   R   t   ost   patht   join(   t	   file_namet   target(   t   scitbx_dist(    sT   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/scitbx/rigid_body/essence/make_bundles.pyt   cpk   s    s   matrix/__init__.pys   scitbx_matrix.pys"   rigid_body/essence/featherstone.pys!   rigid_body/essence/spatial_lib.pys   rigid_body/essence/joint_lib.pys   rigid_body/essence/body_lib.pys   rigid_body/essence/tst_basic.pys
   README.txtt   ws   ..t   ntt   namet   docutilss   scitbx_rigid_body_essence.tgzs   scitbx_rigid_body_essence.zipt   commands?   tar zcf scitbx_rigid_body_essence.tgz scitbx_rigid_body_essences>   zip -r scitbx_rigid_body_essence.zip scitbx_rigid_body_essences*   docutils.rst2html README.txt > README.htmls	   .htaccesss   Options Indexes
(   t   lent   AssertionErrorR   R	   t   isdirt   mkdirt   chdirt   libtbxt   envt	   dist_patht   opent   writet   __doc__R   t
   has_moduleR   R   t   fully_bufferedt   raise_if_errors_or_outputt   isfilet   raise_if_errors(   t   argst   tmpdirR   (    (   R   sT   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/scitbx/rigid_body/essence/make_bundles.pyt   rund   s@    






			
t   __main__i   (   R   t
   __future__R    t   libtbx.utilsR   R   R   R   t   libtbx.load_envt   sysR   R&   t   __name__t   argv(    (    (    sT   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/scitbx/rigid_body/essence/make_bundles.pyt   <module>\   s   	'