mailr28118 - /trunk/lib/structure/pca.py


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

Header


Content

Posted by edward on November 25, 2015 - 18:38:
Author: bugman
Date: Wed Nov 25 18:38:37 2015
New Revision: 28118

URL: http://svn.gna.org/viewcvs/relax?rev=28118&view=rev
Log:
Improved the printouts from the relax library principle component analysis.

This is in the pca_analysis() function of the lib.structure.pca module.

Modified:
    trunk/lib/structure/pca.py

Modified: trunk/lib/structure/pca.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/lib/structure/pca.py?rev=28118&r1=28117&r2=28118&view=diff
==============================================================================
--- trunk/lib/structure/pca.py  (original)
+++ trunk/lib/structure/pca.py  Wed Nov 25 18:38:37 2015
@@ -103,6 +103,7 @@
 
     # Perform an eigenvalue decomposition of the covariance matrix.
     if algorithm == 'eigen':
+        text = 'eigenvalues'
         values, vectors = eigh(covariance_matrix)
 
         # Sort the values and vectors.
@@ -112,6 +113,7 @@
 
     # Perform a singular value decomposition of the covariance matrix.
     elif algorithm == 'svd':
+        text = 'singular values'
         vectors, values, V = svd(covariance_matrix)
 
     # Invalid algorithm.
@@ -119,9 +121,9 @@
         raise RelaxError("The '%s' algorithm is unknown.  It should be 
either 'eigen' or 'svd'." % algorithm)
 
     # Printout.
-    print("\nThe eigenvalues/singular values are:")
+    print("\nThe %s in Angstrom are:" % text)
     for i in range(num_modes):
-        print("Mode %i:  %10.5f" % (i+1, values[i]))
+        print("Mode %i:  %15.5f" % (i+1, values[i]))
 
     # Calculate the projection for each structure.
     proj = zeros((num_modes, M), float64)




Related Messages


Powered by MHonArc, Updated Wed Nov 25 18:40:03 2015