Author: bugman Date: Fri Jul 4 15:53:26 2008 New Revision: 6666 URL: http://svn.gna.org/viewcvs/relax?rev=6666&view=rev Log: Added the ability to select the structure to load the spins from in the load_spins() main method. Modified: branches/rdc_analysis/generic_fns/structure/internal.py branches/rdc_analysis/generic_fns/structure/main.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=6666&r1=6665&r2=6666&view=diff ============================================================================== --- branches/rdc_analysis/generic_fns/structure/internal.py (original) +++ branches/rdc_analysis/generic_fns/structure/internal.py Fri Jul 4 15:53:26 2008 @@ -374,12 +374,15 @@ struct.bonded[index2].append(index1) - def atom_loop(self, atom_id=None, model_num_flag=False, mol_name_flag=False, res_num_flag=False, res_name_flag=False, atom_num_flag=False, atom_name_flag=False, element_flag=False, pos_flag=False): + def atom_loop(self, atom_id=None, str_id=None, model_num_flag=False, mol_name_flag=False, res_num_flag=False, res_name_flag=False, atom_num_flag=False, atom_name_flag=False, element_flag=False, pos_flag=False): """Generator function for looping over all atoms in the internal relax structural object. @keyword atom_id: The molecule, residue, and atom identifier string. Only atoms matching this selection will be yielded. @type atom_id: str + @keyword str_id: The structure identifier. This can be the file name, model + number, or structure number. + @type str_id: int or str @keyword model_num_flag: A flag which if True will cause the model number to be yielded. @type model_num_flag: bool @keyword mol_name_flag: A flag which if True will cause the molecule name to be yielded. Modified: branches/rdc_analysis/generic_fns/structure/main.py URL: http://svn.gna.org/viewcvs/relax/branches/rdc_analysis/generic_fns/structure/main.py?rev=6666&r1=6665&r2=6666&view=diff ============================================================================== --- branches/rdc_analysis/generic_fns/structure/main.py (original) +++ branches/rdc_analysis/generic_fns/structure/main.py Fri Jul 4 15:53:26 2008 @@ -40,11 +40,14 @@ -def load_spins(spin_id=None): +def load_spins(spin_id=None, str_id=None): """Load the spins from the structural object into the relax data store. @keyword spin_id: The molecule, residue, and spin identifier string. @type spin_id: str + @keyword str_id: The structure identifier. This can be the file name, model number, or + structure number. + @type str_id: int or str """ # Test if the current data pipe exists. @@ -59,7 +62,7 @@ cdp = ds[ds.current_pipe] # Loop over all atoms of the spin_id selection. - for mol_name, res_num, res_name, atom_num, atom_name, element, pos in cdp.structure.atom_loop(atom_id=spin_id, 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): + for mol_name, res_num, res_name, atom_num, atom_name, element, pos in cdp.structure.atom_loop(atom_id=spin_id, str_id=str_id, 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 identification string. id = ''