mailr20129 - /trunk/lib/alignment/rdc.py


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

Header


Content

Posted by edward on June 14, 2013 - 18:27:
Author: bugman
Date: Fri Jun 14 18:27:46 2013
New Revision: 20129

URL: http://svn.gna.org/viewcvs/relax?rev=20129&view=rev
Log:
Removed the absolute argument for all of the lib.alignment.rdc functions.

This should be performed at the level of the target function, as mathematical 
operations may be
required prior to taking the absolute value.


Modified:
    trunk/lib/alignment/rdc.py

Modified: trunk/lib/alignment/rdc.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/lib/alignment/rdc.py?rev=20129&r1=20128&r2=20129&view=diff
==============================================================================
--- trunk/lib/alignment/rdc.py (original)
+++ trunk/lib/alignment/rdc.py Fri Jun 14 18:27:46 2013
@@ -1,6 +1,6 @@
 
###############################################################################
 #                                                                            
 #
-# Copyright (C) 2008-2012 Edward d'Auvergne                                  
 #
+# Copyright (C) 2008-2013 Edward d'Auvergne                                  
 #
 #                                                                            
 #
 # This file is part of the program relax (http://www.nmr-relax.com).         
 #
 #                                                                            
 #
@@ -87,7 +87,7 @@
     return dj * val
 
 
-def ave_rdc_tensor(dj, vect, N, A, weights=None, absolute=False):
+def ave_rdc_tensor(dj, vect, N, A, weights=None):
     """Calculate the ensemble average RDC, using the 3D tensor.
 
     This function calculates the average RDC for a set of XH bond vectors 
from a structural ensemble, using the 3D tensorial form of the alignment 
tensor.  The formula for this ensemble average RDC value is::
@@ -136,8 +136,6 @@
     @type A:            numpy rank-2 3D tensor
     @keyword weights:   The weights for each member of the ensemble (the 
last member need not be supplied).
     @type weights:      numpy rank-1 array or None
-    @keyword absolute:  The absolute value or signless RDC flag.
-    @type absolute:     int
     @return:            The average RDC value.
     @rtype:             float
     """
@@ -161,13 +159,10 @@
         val = val + weights[c] * dot(vect[c], dot(A, vect[c]))
 
     # Return the average RDC.
-    if absolute:
-        return abs(dj * val)
-    else:
-        return dj * val
-
-
-def ave_rdc_tensor_dDij_dAmn(dj, vect, N, dAi_dAmn, weights=None, 
absolute=False):
+    return dj * val
+
+
+def ave_rdc_tensor_dDij_dAmn(dj, vect, N, dAi_dAmn, weights=None):
     """Calculate the ensemble average RDC gradient element for Amn, using 
the 3D tensor.
 
     This function calculates the average RDC gradient for a set of XH bond 
vectors from a structural ensemble, using the 3D tensorial form of the 
alignment tensor.  The formula for this ensemble average RDC gradient element 
is::
@@ -203,8 +198,6 @@
     @type dAi_dAmn:     numpy rank-2 3D tensor
     @keyword weights:   The weights for each member of the ensemble (the 
last member need not be supplied).
     @type weights:      numpy rank-1 array
-    @keyword absolute:  The absolute value or signless RDC flag.
-    @type absolute:     int
     @return:            The average RDC gradient element.
     @rtype:             float
     """
@@ -228,13 +221,10 @@
         grad = grad + weights[c] * dot(vect[c], dot(dAi_dAmn, vect[c]))
 
     # Return the average RDC gradient element.
-    if absolute:
-        return dj * grad
-    else:
-        return dj * grad
-
-
-def rdc_tensor(dj, mu, A, absolute=False):
+    return dj * grad
+
+
+def rdc_tensor(dj, mu, A):
     """Calculate the RDC, using the 3D alignment tensor.
 
     The RDC value is::
@@ -274,14 +264,9 @@
     @type mu:           numpy rank-1 3D array
     @param A:           The alignment tensor.
     @type A:            numpy rank-2 3D tensor
-    @keyword absolute:  The absolute value or signless RDC flag.
-    @type absolute:     int
     @return:            The RDC value.
     @rtype:             float
     """
 
     # Return the RDC.
-    if absolute:
-        return abs(dj * dot(mu, dot(A, mu)))
-    else:
-        return dj * dot(mu, dot(A, mu))
+    return dj * dot(mu, dot(A, mu))




Related Messages


Powered by MHonArc, Updated Fri Jun 14 18:40:01 2013