mailr24346 - /branches/frame_order_cleanup/specific_analyses/frame_order/data.py


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

Header


Content

Posted by edward on June 27, 2014 - 16:31:
Author: bugman
Date: Fri Jun 27 16:31:45 2014
New Revision: 24346

URL: http://svn.gna.org/viewcvs/relax?rev=24346&view=rev
Log:
Created an auxiliary function for automatically generating the pivots of the 
frame order analysis.

This is the new specific_analyses.frame_order.data.generate_pivot() function. 
 It will generate the
1st or 2nd pivot, hence supporting both the single motion models and the 
double motion double rotor
model.


Modified:
    branches/frame_order_cleanup/specific_analyses/frame_order/data.py

Modified: branches/frame_order_cleanup/specific_analyses/frame_order/data.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/specific_analyses/frame_order/data.py?rev=24346&r1=24345&r2=24346&view=diff
==============================================================================
--- branches/frame_order_cleanup/specific_analyses/frame_order/data.py  
(original)
+++ branches/frame_order_cleanup/specific_analyses/frame_order/data.py  Fri 
Jun 27 16:31:45 2014
@@ -22,8 +22,12 @@
 # Module docstring.
 """Module for handling the frame order data in the relax data store."""
 
+# Python module imports.
+from numpy import array, float64, zeros
+
 # relax module imports.
 from lib.errors import RelaxError
+from lib.geometry.rotations import euler_to_R_zyz
 from pipe_control.interatomic import interatomic_loop
 from pipe_control.mol_res_spin import spin_loop
 
@@ -91,6 +95,40 @@
         return cdp.domain[id]
 
 
+def generate_pivot(order=1):
+    """Create and return the given pivot.
+
+    @keyword order: The pivot number with 1 corresponding to the first 
pivot, 2 to the second, etc.
+    @type order:    int
+    @return:        The give pivot point.
+    @rtype:         numpy 3D rank-1 float64 array
+    """
+
+    # Initialise.
+    pivot = None
+
+    # The first pivot point.
+    if order == 1:
+        pivot = array([cdp.pivot_x, cdp.pivot_y, cdp.pivot_z], float64)
+
+    # The 2nd pivot.
+    elif order == 2:
+        # The double rotor parameterisation.
+        if cdp.model in ['double rotor']:
+            # The first pivot.
+            pivot_1st = array([cdp.pivot_x, cdp.pivot_y, cdp.pivot_z], 
float64)
+
+            # The eigenframe.
+            frame = zeros((3, 3), float64)
+            euler_to_R_zyz(cdp.eigen_alpha, cdp.eigen_beta, cdp.eigen_gamma, 
frame)
+
+            # The 2nd pivot.
+            pivot = pivot_1st + frame[:,2] * cdp.pivot_disp
+
+    # Return the pivot.
+    return pivot
+
+
 def pivot_fixed():
     """Determine if the pivot is fixed or not.
 




Related Messages


Powered by MHonArc, Updated Fri Jun 27 17:20:02 2014