Author: bugman Date: Tue Jan 27 16:51:47 2009 New Revision: 8680 URL: http://svn.gna.org/viewcvs/relax?rev=8680&view=rev Log: The __linear_ave() now handles the coordinates as numpy arrays. 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=8680&r1=8679&r2=8680&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:51:47 2009 @@ -36,6 +36,7 @@ """ # Python module imports. +from numpy import array from re import split from string import strip from textwrap import fill @@ -496,16 +497,16 @@ @param positions: The atomic positions. The first index is that of the positions to be 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 + @type positions: list of lists of numpy float arrays @return: The averaged positions as a list of vectors. - @rtype: rank-2 list of floats + @rtype: list of numpy float arrays """ # Loop over the multiple models. ave = [] for model_index in range(len(positions[0])): # Append an empty vector. - ave.append([0.0, 0.0, 0.0]) + ave.append(array([0.0, 0.0, 0.0])) # Loop over the x, y, and z coordinates. for coord_index in range(3):