Author: bugman Date: Mon Jun 11 22:57:09 2012 New Revision: 16876 URL: http://svn.gna.org/viewcvs/relax?rev=16876&view=rev Log: The N-state model specific analysis code is now handling RDCs as interatomic data. This still has a lot of work before it will be functional. Modified: branches/interatomic/specific_fns/n_state_model.py Modified: branches/interatomic/specific_fns/n_state_model.py URL: http://svn.gna.org/viewcvs/relax/branches/interatomic/specific_fns/n_state_model.py?rev=16876&r1=16875&r2=16876&view=diff ============================================================================== --- branches/interatomic/specific_fns/n_state_model.py (original) +++ branches/interatomic/specific_fns/n_state_model.py Mon Jun 11 22:57:09 2012 @@ -39,6 +39,7 @@ from float import isNaN, isInf import generic_fns from generic_fns.align_tensor import all_tensors_fixed, get_tensor_object, num_tensors, return_tensor +from generic_fns.interatomic import interatomic_loop from generic_fns.mol_res_spin import return_spin, spin_loop from generic_fns import pcs, pipes, rdc from generic_fns.structure.cones import Iso_cone @@ -245,8 +246,8 @@ list = [] # RDC search. - for spin in spin_loop(): - if hasattr(spin, 'rdc'): + for interatom in interatomic_loop(): + if hasattr(interatom, 'rdc'): list.append('rdc') break @@ -805,18 +806,20 @@ # Add the back calculated PCS (in ppm). spin.pcs_bc[align_id] = model.deltaij_theta[i, data_index] * 1e6 - # Spins with RDC data. - if rdc_flag and hasattr(spin, 'rdc') and (hasattr(spin, 'xh_vect') or hasattr(spin, 'bond_vect')): + # Increment the spin index if it contains data. + if hasattr(spin, 'pcs') and (hasattr(spin, 'xh_vect') or hasattr(spin, 'bond_vect'))): + data_index = data_index + 1 + + # Interatomic data container loop. + for interatom in interatomic_loop(): + # Containers with RDC data. + if rdc_flag and hasattr(interatom, 'rdc'): # Initialise the data structure if necessary. - if not hasattr(spin, 'rdc_bc'): - spin.rdc_bc = {} + if not hasattr(interatom, 'rdc_bc'): + interatom.rdc_bc = {} # Append the back calculated PCS. - spin.rdc_bc[align_id] = model.Dij_theta[i, data_index] - - # Increment the spin index if it contains data. - if hasattr(spin, 'pcs') or (hasattr(spin, 'rdc') and (hasattr(spin, 'xh_vect') or hasattr(spin, 'bond_vect'))): - data_index = data_index + 1 + interatom.rdc_bc[align_id] = model.Dij_theta[i, data_index] def _minimise_setup_atomic_pos(self): @@ -836,7 +839,7 @@ continue # Only use spins with alignment/paramagnetic data. - if not hasattr(spin, 'pcs') and not hasattr(spin, 'rdc') and not hasattr(spin, 'pre'): + if not hasattr(spin, 'pcs') and not hasattr(spin, 'pre'): continue # The position list.