Author: bugman Date: Wed Jul 9 16:49:43 2008 New Revision: 6896 URL: http://svn.gna.org/viewcvs/relax?rev=6896&view=rev Log: Created maxA() for finding the maximal alignment or the Azz component in the alignment frame. Modified: branches/rdc_analysis/maths_fns/rdc.py Modified: branches/rdc_analysis/maths_fns/rdc.py URL: http://svn.gna.org/viewcvs/relax/branches/rdc_analysis/maths_fns/rdc.py?rev=6896&r1=6895&r2=6896&view=diff ============================================================================== --- branches/rdc_analysis/maths_fns/rdc.py (original) +++ branches/rdc_analysis/maths_fns/rdc.py Wed Jul 9 16:49:43 2008 @@ -22,6 +22,9 @@ # Module docstring. """Module containing functions for the calculation of RDCs.""" + +# Python imports. +from numpy.linalg import eigvals def average_rdc_5D(vect, K, Axx, Ayy, Axy, Axz, Ayz): @@ -119,6 +122,18 @@ return val / K +def maxA(tensor): + """Find the maximal alignment - the Azz component in the alignment frame. + + @param tensor: The alignment tensor object. + @type tensor: numpy rank-2 3D tensor + @return: The Azz component in the alignment frame. + """ + + # Return the value. + return max(abs(eigvals(tensor))) + + def to_5D(5D_vector, tensor): """Convert the rank-2 3D alignment tensor matrix to the 5D vector format.