Author: bugman Date: Mon Oct 26 19:57:48 2009 New Revision: 9793 URL: http://svn.gna.org/viewcvs/relax?rev=9793&view=rev Log: Merged revisions 9709,9747 via svnmerge from svn+ssh://bugman@xxxxxxxxxxx/svn/relax/1.3 ........ r9709 | bugman | 2009-10-09 20:06:21 +0200 (Fri, 09 Oct 2009) | 3 lines Comment fix. ........ r9747 | bugman | 2009-10-12 16:00:39 +0200 (Mon, 12 Oct 2009) | 3 lines __linear_ave() is no longer a private function. ........ Modified: branches/bmrb/ (props changed) branches/bmrb/data/pipe_container.py branches/bmrb/generic_fns/mol_res_spin.py Propchange: branches/bmrb/ ------------------------------------------------------------------------------ --- svnmerge-integrated (original) +++ svnmerge-integrated Mon Oct 26 19:57:48 2009 @@ -1,1 +1,1 @@ -/1.3:1-9706 +/1.3:1-9792 Modified: branches/bmrb/data/pipe_container.py URL: http://svn.gna.org/viewcvs/relax/branches/bmrb/data/pipe_container.py?rev=9793&r1=9792&r2=9793&view=diff ============================================================================== --- branches/bmrb/data/pipe_container.py (original) +++ branches/bmrb/data/pipe_container.py Mon Oct 26 19:57:48 2009 @@ -144,7 +144,7 @@ # Get the alignment tensor data nodes and, if they exist, fill the contents. align_tensor_nodes = relax_node.getElementsByTagName('align_tensors') if align_tensor_nodes: - # Create the diffusion tensor object. + # Create the alignment tensor object. self.align_tensors = AlignTensorList() # Fill its contents. Modified: branches/bmrb/generic_fns/mol_res_spin.py URL: http://svn.gna.org/viewcvs/relax/branches/bmrb/generic_fns/mol_res_spin.py?rev=9793&r1=9792&r2=9793&view=diff ============================================================================== --- branches/bmrb/generic_fns/mol_res_spin.py (original) +++ branches/bmrb/generic_fns/mol_res_spin.py Mon Oct 26 19:57:48 2009 @@ -491,36 +491,6 @@ -def __linear_ave(positions): - """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 index is over the different models. The last - index is over the x, y, and z coordinates. - @type positions: list of lists of numpy float arrays - @return: The averaged positions as a list of vectors. - @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(array([0.0, 0.0, 0.0])) - - # Loop over the x, y, and z coordinates. - for coord_index in range(3): - # Loop over the atomic positions. - for atom_index in range(len(positions)): - ave[model_index][coord_index] = ave[model_index][coord_index] + positions[atom_index][model_index][coord_index] - - # Average. - ave[model_index][coord_index] = ave[model_index][coord_index] / len(positions) - - # Return the averaged positions. - return ave - - def bmrb_read(star): """Generate the molecule and residue spin containers from the entity saveframe records. @@ -1006,7 +976,7 @@ spin.averaging = averaging spin.members = members if averaging == 'linear': - spin.pos = __linear_ave(positions) + spin.pos = linear_ave(positions) def create_spin(spin_num=None, spin_name=None, res_num=None, res_name=None, mol_name=None): @@ -1564,6 +1534,36 @@ # Yield the molecule data container. yield mol + + +def linear_ave(positions): + """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 index is over the different models. The last + index is over the x, y, and z coordinates. + @type positions: list of lists of numpy float arrays + @return: The averaged positions as a list of vectors. + @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(array([0.0, 0.0, 0.0])) + + # Loop over the x, y, and z coordinates. + for coord_index in range(3): + # Loop over the atomic positions. + for atom_index in range(len(positions)): + ave[model_index][coord_index] = ave[model_index][coord_index] + positions[atom_index][model_index][coord_index] + + # Average. + ave[model_index][coord_index] = ave[model_index][coord_index] / len(positions) + + # Return the averaged positions. + return ave def name_molecule(mol_id, name=None, force=False):