mailr5936 - /1.3/generic_fns/diffusion_tensor.py


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

Header


Content

Posted by edward on April 21, 2008 - 17:41:
Author: bugman
Date: Mon Apr 21 17:41:30 2008
New Revision: 5936

URL: http://svn.gna.org/viewcvs/relax?rev=5936&view=rev
Log:
Converted the return_conversion_factor() function to the new design.


Modified:
    1.3/generic_fns/diffusion_tensor.py

Modified: 1.3/generic_fns/diffusion_tensor.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/generic_fns/diffusion_tensor.py?rev=5936&r1=5935&r2=5936&view=diff
==============================================================================
--- 1.3/generic_fns/diffusion_tensor.py (original)
+++ 1.3/generic_fns/diffusion_tensor.py Mon Apr 21 17:41:30 2008
@@ -680,11 +680,19 @@
     return labels, tick_locations, tick_values
 
 
-def return_conversion_factor(param):
+def return_conversion_factor(param, spin_id=None):
     """Function for returning the factor of conversion between different 
parameter units.
 
     For example, the internal representation of tm is in seconds, whereas 
the external
     representation is in nanoseconds, therefore this function will return 
1e-9 for tm.
+
+
+    @param param:       The name of the parameter to return the conversion 
factor for.
+    @type param:        str
+    @keyword spin_id:   The spin identification string.  This arg is unused.
+    @type spin_id:      None or str
+    @return:            The conversion factor.
+    @rtype:             float
     """
 
     # Get the object name.
@@ -695,16 +703,15 @@
         return 1e-9
 
     # Diso, Da, Dx, Dy, Dz, Dpar, Dper.
-    elif object_name in ['Diso', 'Da', 'Dx', 'Dy', 'Dz', 'Dpar', 'Dper']:
+    if object_name in ['Diso', 'Da', 'Dx', 'Dy', 'Dz', 'Dpar', 'Dper']:
         return 1e6
 
     # Angles.
-    elif object_name in ['theta', 'phi', 'alpha', 'beta', 'gamma']:
+    if object_name in ['theta', 'phi', 'alpha', 'beta', 'gamma']:
         return (2.0*pi) / 360.0
 
     # No conversion factor.
-    else:
-        return 1.0
+    return 1.0
 
 
 def return_data_name(name):




Related Messages


Powered by MHonArc, Updated Mon Apr 21 18:00:16 2008