mailr14885 - /1.3/prompt/structure.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on October 23, 2011 - 18:56:
Author: bugman
Date: Sun Oct 23 18:56:36 2011
New Revision: 14885

URL: http://svn.gna.org/viewcvs/relax?rev=14885&view=rev
Log:
Created the front end for the new structure.rotate user function.

The purpose of this user function is to apply arbitrary rotations to the 
structures loaded into
relax about a given origin.


Modified:
    1.3/prompt/structure.py

Modified: 1.3/prompt/structure.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/prompt/structure.py?rev=14885&r1=14884&r2=14885&view=diff
==============================================================================
--- 1.3/prompt/structure.py (original)
+++ 1.3/prompt/structure.py Sun Oct 23 18:56:36 2011
@@ -438,6 +438,34 @@
         generic_fns.structure.main.read_xyz(file=file, dir=dir, 
read_mol=read_mol, set_mol_name=set_mol_name, read_model=read_model, 
set_model_num=set_model_num)
 
 
+    def rotate(self, R=None, origin=None):
+        # Function intro text.
+        if self._exec_info.intro:
+            text = self._exec_info.ps3 + "structure.rotate("
+            text = text + "R=" + repr(R)
+            text = text + ", origin=" + repr(origin) + ")"
+            print(text)
+
+        # The argument checks.
+        arg_check.is_float_matrix(R, 'rotation matrix', dim=(3,3))
+        arg_check.is_float_array(origin, 'origin of rotation', size=3, 
can_be_none=True)
+
+        # Execute the functional code.
+        generic_fns.structure.main.rotate(R=R, origin=origin)
+
+    # The function doc info.
+    rotate._doc_title = "Rotate the internal structural object about the 
given origin by the rotation matrix."
+    rotate._doc_title_short = "Structure rotation."
+    rotate._doc_args = [
+        ["R", "The rotation matrix in forwards rotation notation."],
+        ["origin", "The origin or pivot of the rotation."]
+    ]
+    rotate._doc_desc = """
+        This is used to rotate the internal structural data by the given 
rotation matrix.  If the origin is supplied, then this will act as the pivot 
of the rotation.  Otherwise, all structural data will be rotated about the 
point [0, 0, 0].
+        """
+    _build_doc(rotate)
+
+
     def vectors(self, attached='H', spin_id=None, model=None, verbosity=1, 
ave=True, unit=True):
         # Function intro text.
         if self._exec_info.intro:




Related Messages


Powered by MHonArc, Updated Sun Oct 23 19:00:02 2011