mailr25206 - /trunk/lib/structure/represent/diffusion_tensor.py


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

Header


Content

Posted by edward on August 22, 2014 - 12:08:
Author: bugman
Date: Fri Aug 22 12:08:09 2014
New Revision: 25206

URL: http://svn.gna.org/viewcvs/relax?rev=25206&view=rev
Log:
Fix for bug #22502 (https://gna.org/bugs/?22502).

This is the problem whereby the geometric prolate diffusion representation 
does not align with axis
in PDB, as reported by Martin Ballaschk (https://gna.org/users/mab).

This problem was not the main prolate tensor axis, but that the geometric 
object needed to be
rotated 90 degrees about the z-axis to bring the object and axis into the 
same frame.


Modified:
    trunk/lib/structure/represent/diffusion_tensor.py

Modified: trunk/lib/structure/represent/diffusion_tensor.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/lib/structure/represent/diffusion_tensor.py?rev=25206&r1=25205&r2=25206&view=diff
==============================================================================
--- trunk/lib/structure/represent/diffusion_tensor.py   (original)
+++ trunk/lib/structure/represent/diffusion_tensor.py   Fri Aug 22 12:08:09 
2014
@@ -68,12 +68,24 @@
     # Print out.
     print("\nGenerating the geometric object.")
 
+    # Swap the x and y axes for the prolate spheroid (the vector 
distributions are centred on the z-axis).
+    if diff_type == 'prolate':
+        # 90 deg rotation about the diffusion frame z-axis.
+        z_rot = array([[  0, -1,  0],
+                       [  1,  0,  0],
+                       [  0,  0,  1]], float64)
+
+        # Rotate the tensor and rotation matrix.
+        rotation = dot(transpose(rotation), z_rot)
+        tensor = dot(z_rot, dot(tensor_diag, transpose(z_rot)))
+        tensor = dot(rotation, dot(tensor, transpose(rotation)))
+
     # Swap the x and z axes for the oblate spheroid (the vector 
distributions are centred on the z-axis).
     if diff_type == 'oblate':
         # 90 deg rotation about the diffusion frame y-axis.
-        y_rot = array([[  0, 0,  1],
-                       [  0, 1,  0],
-                       [ -1, 0,  0]], float64)
+        y_rot = array([[  0,  0,  1],
+                       [  0,  1,  0],
+                       [ -1,  0,  0]], float64)
 
         # Rotate the tensor and rotation matrix.
         rotation = dot(transpose(rotation), y_rot)




Related Messages


Powered by MHonArc, Updated Fri Aug 22 12:20:01 2014