mailr11678 - /1.3/data/diff_tensor.py


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

Header


Content

Posted by edward on November 18, 2010 - 16:52:
Author: bugman
Date: Thu Nov 18 16:52:49 2010
New Revision: 11678

URL: http://svn.gna.org/viewcvs/relax?rev=11678&view=rev
Log:
Fix for the spheroid diffusion tensors for a recently introduced bug.

The oblate and prolate check was failing as the 'spheroid_type' variable was 
set to None after a
call to diffusion_tensor.init().  'spheroid_type' is now automatically 
updated if Da is changed.


Modified:
    1.3/data/diff_tensor.py

Modified: 1.3/data/diff_tensor.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/data/diff_tensor.py?rev=11678&r1=11677&r2=11678&view=diff
==============================================================================
--- 1.3/data/diff_tensor.py (original)
+++ 1.3/data/diff_tensor.py Thu Nov 18 16:52:49 2010
@@ -393,6 +393,22 @@
         raise RelaxError('The diffusion tensor has not been specified')
 
 
+def calc_spheroid_type(Da):
+    """Determine the spheroid type.
+
+    @keyword Da:    The diffusion tensor anisotropy.
+    @type Da:       float
+    @return:        The spheroid type, either 'oblate' or 'prolate'.
+    @rtype:         str
+    """
+
+    # The spheroid type.
+    if Da > 0.0:
+        return 'prolate'
+    else:
+        return 'oblate'
+
+
 def calc_tensor(rotation, tensor_diag):
     """Function for calculating the diffusion tensor (in the structural 
frame).
 
@@ -513,9 +529,7 @@
 
     @param diff_type:   The type of Brownian rotational diffusion.
     @type diff_type:    str
-    @return:            This generator successively yields three objects, 
the target object to
-                        update, the list of parameters which if modified 
cause the target to be
-                        updated, and the list of parameters that the target 
depends upon.
+    @return:            This generator successively yields three objects, 
the target object to update, the list of parameters which if modified cause 
the target to be updated, and the list of parameters that the target depends 
upon.
     """
 
     # Spherical diffusion.
@@ -535,6 +549,7 @@
         yield ('tensor_diag',   ['tm', 'Da'],                   ['type', 
'Dpar', 'Dper'])
         yield ('rotation',      ['theta', 'phi'],               ['type', 
'spheroid_type', 'theta', 'phi'])
         yield ('tensor',        ['tm', 'Da', 'theta', 'phi'],   ['rotation', 
'tensor_diag'])
+        yield ('spheroid_type', ['Da'],                         ['Da'])
 
     # Ellipsoidal diffusion.
     elif diff_type == 'ellipsoid':




Related Messages


Powered by MHonArc, Updated Thu Nov 18 17:20:02 2010