Author: bugman Date: Wed Dec 3 21:51:10 2008 New Revision: 8113 URL: http://svn.gna.org/viewcvs/relax?rev=8113&view=rev Log: Bug fix for the centre_of_mass() function. The spin id string is now created to correctly return the molecule, residue, and spin containers. Modified: 1.3/generic_fns/structure/mass.py Modified: 1.3/generic_fns/structure/mass.py URL: http://svn.gna.org/viewcvs/relax/1.3/generic_fns/structure/mass.py?rev=8113&r1=8112&r2=8113&view=diff ============================================================================== --- 1.3/generic_fns/structure/mass.py (original) +++ 1.3/generic_fns/structure/mass.py Wed Dec 3 21:51:10 2008 @@ -60,23 +60,29 @@ # Loop over all atoms. for mol_name, res_num, res_name, atom_num, atom_name, element, pos in cdp.structure.atom_loop(mol_name_flag=True, res_num_flag=True, res_name_flag=True, atom_num_flag=True, atom_name_flag=True, element_flag=True, pos_flag=True): + # Initialise the spin id string. + id = '' + # Get the corresponding molecule container. if mol_name == None: mol_cont = cdp.mol[0] else: - mol_cont = return_molecule('#' + mol_name) + id = id + '#' + mol_name + mol_cont = return_molecule(id) # Get the corresponding residue container. if res_name == None and res_num == None: res_cont = mol_cont.res[0] else: - res_cont = return_residue(':' + `res_num`) + id = id + ':' + `res_num` + res_cont = return_residue(id) # Get the corresponding spin container. if atom_name == None and atom_num == None: spin_cont = res_cont.spin[0] else: - spin_cont = return_spin('@' + `atom_num`) + id = id + '@' + `atom_num` + spin_cont = return_spin(id) # Deselected spins. if spin_cont and not spin_cont.select: