mailr4631 - /branches/N_state_model/generic_fns/align_tensor.py


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

Header


Content

Posted by edward on January 11, 2008 - 11:15:
Author: bugman
Date: Fri Jan 11 11:15:17 2008
New Revision: 4631

URL: http://svn.gna.org/viewcvs/relax?rev=4631&view=rev
Log:
Updated generic_fns.align_tensor.matrix_angles() to use the tensors arg.


Modified:
    branches/N_state_model/generic_fns/align_tensor.py

Modified: branches/N_state_model/generic_fns/align_tensor.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/N_state_model/generic_fns/align_tensor.py?rev=4631&r1=4630&r2=4631&view=diff
==============================================================================
--- branches/N_state_model/generic_fns/align_tensor.py (original)
+++ branches/N_state_model/generic_fns/align_tensor.py Fri Jan 11 11:15:17 
2008
@@ -707,7 +707,7 @@
     return labels, tick_locations, tick_values
 
 
-def matrix_angles(basis_set=0):
+def matrix_angles(basis_set=0, tensors=None):
     """Function for calculating the 5D angles between the alignment tensors.
 
     The basis set used for the 5D vector construction changes the angles 
calculated.
@@ -716,6 +716,8 @@
                         basis set is {Sxx, Syy, Sxy, Sxz, Syz}.  If 1, then 
the basis set is {Szz,
                         Sxxyy, Sxy, Sxz, Syz}.
     @type basis_set:    int
+    @param tensors:     An array of tensors to apply SVD to.  If None, all 
tensors will be used.
+    @type tensors:      None or array of str
     """
 
     # Alias the current data pipe.
@@ -725,8 +727,11 @@
     if not hasattr(cdp, 'align_tensor') or len(cdp.align_tensor) == 0:
         raise RelaxNoTensorError, 'alignment'
 
-    # The number of tensors.
-    tensor_num = len(cdp.align_tensor)
+    # Count the number of tensors.
+    tensor_num = 0
+    for tensor in cdp.align_tensor:
+        if tensors and tensor.name in tensors:
+            tensor_num = tensor_num + 1
 
     # Create the matrix which contains the 5D vectors.
     matrix = zeros((tensor_num, 5), float64)
@@ -734,6 +739,10 @@
     # Loop over the tensors.
     i = 0
     for tensor in cdp.align_tensor:
+        # Skip tensors.
+        if tensors and tensor.name not in tensors:
+            continue
+
         # Unitary basis set.
         if basis_set == 0:
             # Pack the elements.




Related Messages


Powered by MHonArc, Updated Fri Jan 11 11:20:08 2008