Author: bugman Date: Wed Jan 9 18:15:19 2008 New Revision: 4573 URL: http://svn.gna.org/viewcvs/relax?rev=4573&view=rev Log: Wrote the set_domain() method for the N-state model specific code. Because of the structure of the alignment tensor object, this code doesn't work yet. Modified: branches/N_state_model/specific_fns/n_state_model.py Modified: branches/N_state_model/specific_fns/n_state_model.py URL: http://svn.gna.org/viewcvs/relax/branches/N_state_model/specific_fns/n_state_model.py?rev=4573&r1=4572&r2=4573&view=diff ============================================================================== --- branches/N_state_model/specific_fns/n_state_model.py (original) +++ branches/N_state_model/specific_fns/n_state_model.py Wed Jan 9 18:15:19 2008 @@ -156,3 +156,28 @@ # CSA. if search('^[Cc][Ss][Aa]$', name): return 'csa' + + + def set_domain(self, tensor=None, domain=None): + """Set the domain label for the given tensor. + + @param tensor: The alignment tensor label. + @type tensor: str + @param domain: The domain label. + @type domain: str + """ + + # Alias the current data pipe. + cdp = relax_data_store[relax_data_store.current_pipe] + + # Loop over the tensors. + match = False + for tensor_cont in cdp.align_tensor: + # Find the matching tensor and then store the domain label. + if tensor_cont.name == tensor: + tensor_cont.domain = domain + match = True + + # The tensor label doesn't exist. + if not match: + raise RelaxNoTensorError, ('diffusion', tensor)