mailr8674 - /branches/ave_noe/generic_fns/mol_res_spin.py


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

Header


Content

Posted by edward on January 27, 2009 - 16:27:
Author: bugman
Date: Tue Jan 27 16:27:54 2009
New Revision: 8674

URL: http://svn.gna.org/viewcvs/relax?rev=8674&view=rev
Log:
Fixes for the create_pseudo_spin() and __linear_ave() functions.


Modified:
    branches/ave_noe/generic_fns/mol_res_spin.py

Modified: branches/ave_noe/generic_fns/mol_res_spin.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/ave_noe/generic_fns/mol_res_spin.py?rev=8674&r1=8673&r2=8674&view=diff
==============================================================================
--- branches/ave_noe/generic_fns/mol_res_spin.py (original)
+++ branches/ave_noe/generic_fns/mol_res_spin.py Tue Jan 27 16:27:54 2009
@@ -494,22 +494,12 @@
     """Perform linear averaging of the atomic positions.
 
     @param positions:   The atomic positions.  The first index is that of 
the positions to be
-                        averaged over.  The second, optionally, can be the 
different models if
-                        present.  The last index is over the x, y, and z 
coordinates.
-    @type positions:    rank-2 list of floats or rank-3 list of floats
-    @return:            The averaged positions.  Either a single vector or 
an list of vectors.
-    @rtype:             rank-1 list of floats or rank-2 list of floats
-    """
-
-    # Multi-model averaging.
-    multi_model = False
-    if type(positions[0][0]) == list:
-        multi_model = True
-
-    # Convert a rank-2 list into a rank-3 list (avoid code duplication).
-    if not multi_model:
-        for i in range(len(positions)):
-            positions[i] = [positions[i]]
+                        averaged over.  The second index is over the 
different models.  The last
+                        index is over the x, y, and z coordinates.
+    @type positions:    rank-3 list of floats
+    @return:            The averaged positions as a list of vectors.
+    @rtype:             rank-2 list of floats
+    """
 
     # Loop over the multiple models.
     ave = []
@@ -924,7 +914,9 @@
             raise RelaxError, "Positional information is not available for 
the atom '%s'." % atom
 
         # Store the position.
-        positions.append(spin.pos)
+        positions.append([])
+        for i in range(len(spin.pos)):
+            positions[-1].append(spin.pos[i].tolist())
 
     # Add the spin.
     res_to_cont.spin.add_item(spin_num=spin_num, spin_name=spin_name)




Related Messages


Powered by MHonArc, Updated Tue Jan 27 16:40:02 2009