mailr6924 - /branches/rdc_analysis/maths_fns/rdc.py


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

Header


Content

Posted by edward on July 09, 2008 - 19:44:
Author: bugman
Date: Wed Jul  9 19:44:35 2008
New Revision: 6924

URL: http://svn.gna.org/viewcvs/relax?rev=6924&view=rev
Log:
Converted average_rdc_5D() to expect a numpy array for the 5D tensor.


Modified:
    branches/rdc_analysis/maths_fns/rdc.py

Modified: branches/rdc_analysis/maths_fns/rdc.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/rdc_analysis/maths_fns/rdc.py?rev=6924&r1=6923&r2=6924&view=diff
==============================================================================
--- branches/rdc_analysis/maths_fns/rdc.py (original)
+++ branches/rdc_analysis/maths_fns/rdc.py Wed Jul  9 19:44:35 2008
@@ -27,7 +27,7 @@
 from numpy.linalg import eigvals
 
 
-def average_rdc_5D(vect, K, Axx, Ayy, Axy, Axz, Ayz):
+def average_rdc_5D(vect, K, A):
     """Calculate the average RDC for an ensemble set of XH bond vectors, 
using the 5D notation.
 
     This function calculates the average RDC for a set of XH bond vectors 
from a structural
@@ -54,16 +54,8 @@
     @type vect:         numpy matrix
     @param K:           The total number of structures.
     @type K:            int
-    @param Axx:         The xx component of the alignment tensor.
-    @type Axx:          float
-    @param Ayy:         The yy component of the alignment tensor.
-    @type Ayy:          float
-    @param Axy:         The xy component of the alignment tensor.
-    @type Axy:          float
-    @param Axz:         The xz component of the alignment tensor.
-    @type Axz:          float
-    @param Ayz:         The yz component of the alignment tensor.
-    @type Ayz:          float
+    @param vector_5D:   The 5D vector object.  The vector format is {Axx, 
Ayy, Axy, Axz, Ayz}.
+    @type vector_5D:    numpy 5D vector
     """
 
     # Initial back-calculated RDC value.
@@ -72,7 +64,7 @@
     # Loop over the structures k.
     for k in xrange(K):
         # Back-calculate the RDC.
-        val = val + (vect[k,0]**2 - vect[k,2]**2)*Axx + (vect[k,1]**2 - 
vect[k,2]**2)*Ayy + 2.0*vect[k,0]*vect[k,1]*Axy + 2.0*vect[k,0]*vect[k,2]*Axz 
+ 2.0*vect[k,1]*vect[k,2]*Ayz
+        val = val + (vect[k,0]**2 - vect[k,2]**2)*A[0] + (vect[k,1]**2 - 
vect[k,2]**2)*A[1] + 2.0*vect[k,0]*vect[k,1]*A[2] + 
2.0*vect[k,0]*vect[k,2]*A[3] + 2.0*vect[k,1]*vect[k,2]*A[4]
 
     # Return the average RDC.
     return val / K




Related Messages


Powered by MHonArc, Updated Wed Jul 09 20:00:15 2008