Author: bugman Date: Fri Jul 4 19:03:49 2008 New Revision: 6683 URL: http://svn.gna.org/viewcvs/relax?rev=6683&view=rev Log: Created the __atom_index() method to find the atom index corresponding to an atom number. Modified: branches/rdc_analysis/generic_fns/structure/internal.py Modified: branches/rdc_analysis/generic_fns/structure/internal.py URL: http://svn.gna.org/viewcvs/relax/branches/rdc_analysis/generic_fns/structure/internal.py?rev=6683&r1=6682&r2=6683&view=diff ============================================================================== --- branches/rdc_analysis/generic_fns/structure/internal.py (original) +++ branches/rdc_analysis/generic_fns/structure/internal.py Fri Jul 4 19:03:49 2008 @@ -47,6 +47,22 @@ # Identification string. id = 'internal' + + + def __atom_index(self, atom_num): + """Find the atom index corresponding to the given atom number. + + @param atom_num: The atom number to find the index of. + @type atom_num: int + @return: The atom index corresponding to the atom. + @rtype: int + """ + + # Loop over the atoms. + for i in xrange(len(self.structural_data[self.struct_index])): + # Return the index. + if self.structural_data[self.struct_index].atom_num[i] == atom_num: + return i def __fill_object_from_pdb(self, records, struct_index):