mailr11300 - /1.3/data/align_tensor.py


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

Header


Content

Posted by edward on July 15, 2010 - 13:39:
Author: bugman
Date: Thu Jul 15 13:39:35 2010
New Revision: 11300

URL: http://svn.gna.org/viewcvs/relax?rev=11300&view=rev
Log:
Fix for the alignment tensor rotation matrix - it is now always in the right 
handed universe.


Modified:
    1.3/data/align_tensor.py

Modified: 1.3/data/align_tensor.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/data/align_tensor.py?rev=11300&r1=11299&r2=11300&view=diff
==============================================================================
--- 1.3/data/align_tensor.py (original)
+++ 1.3/data/align_tensor.py Thu Jul 15 13:39:35 2010
@@ -24,7 +24,7 @@
 from re import search
 from math import cos, sin
 from numpy import array, dot, eye, float64, identity, transpose, zeros
-from numpy.linalg import eig, eigvals
+from numpy.linalg import det, eig, eigvals
 from types import ListType
 
 # relax module imports.
@@ -800,6 +800,10 @@
         for j in range(3):
             rot_perm[i, j] = rot[i, perm[j]]
 
+    # Switch from the left handed to right handed universe if required.
+    if abs(det(rot_perm) - 1.0) > 1e-7:
+        rot_perm[:,0] = -rot_perm[:,0]
+
     # Return the permuted rotation matrix.
     return rot_perm
 




Related Messages


Powered by MHonArc, Updated Thu Jul 15 15:40:01 2010