mailr16961 - /branches/interatomic/specific_fns/model_free/main.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on June 19, 2012 - 16:21:
Author: bugman
Date: Tue Jun 19 16:21:59 2012
New Revision: 16961

URL: http://svn.gna.org/viewcvs/relax?rev=16961&view=rev
Log:
Fix for the model-free duplicate_data() method for interatomic data.

This is used by the model_selection user function.  The problem was that no 
proton spins where being
copied as previously there were no proton spins in a model-free analysis.  
This spins are now needed
to define the dipolar relaxation mechanism.


Modified:
    branches/interatomic/specific_fns/model_free/main.py

Modified: branches/interatomic/specific_fns/model_free/main.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/interatomic/specific_fns/model_free/main.py?rev=16961&r1=16960&r2=16961&view=diff
==============================================================================
--- branches/interatomic/specific_fns/model_free/main.py (original)
+++ branches/interatomic/specific_fns/model_free/main.py Tue Jun 19 16:21:59 
2012
@@ -34,7 +34,7 @@
 from data.diff_tensor import DiffTensorSimList
 from float import isNaN, isInf
 from generic_fns import diffusion_tensor, interatomic, pipes, relax_data, 
sequence
-from generic_fns.mol_res_spin import convert_from_global_index, count_spins, 
exists_mol_res_spin_data, find_index, return_spin, return_spin_from_index, 
spin_index_loop, spin_loop
+from generic_fns.mol_res_spin import convert_from_global_index, count_spins, 
exists_mol_res_spin_data, find_index, return_spin, return_spin_from_index, 
return_spin_indices, spin_index_loop, spin_loop
 from maths_fns.mf import Mf
 from minfx.generic import generic_minimise
 import specific_fns
@@ -1487,12 +1487,31 @@
         model_type = self._determine_model_type()
 
         # Sequence specific data.
+        spin, spin_id = return_spin_from_index(model_info, pipe=pipe_from, 
return_spin_id=True)
         if model_type == 'mf' or (model_type == 'local_tm' and not 
global_stats):
             # Get the spin container indices.
             mol_index, res_index, spin_index = 
convert_from_global_index(global_index=model_info, pipe=pipe_from)
 
             # Duplicate the spin specific data.
-            dp_to.mol[mol_index].res[res_index].spin[spin_index] = 
deepcopy(dp_from.mol[mol_index].res[res_index].spin[spin_index])
+            dp_to.mol[mol_index].res[res_index].spin[spin_index] = 
deepcopy(spin)
+
+            # Duplicate the relaxation active spins which have not been 
copied yet.
+            interatoms = interatomic.return_interatom(spin_id)
+            for interatom in interatoms:
+                # No relaxation mechanism.
+                if not interatom.dipole_pair:
+                    continue
+
+                # The interacting spin.
+                if spin_id != interatom.spin_id1:
+                    spin_id2 = interatom.spin_id1
+                else:
+                    spin_id2 = interatom.spin_id2
+                spin2 = return_spin(spin_id2)
+
+                # Duplicate the spin specific data.
+                mol_index, res_index, spin_index = 
return_spin_indices(spin_id2)
+                dp_to.mol[mol_index].res[res_index].spin[spin_index] = 
deepcopy(spin2)
 
         # Other data types.
         else:




Related Messages


Powered by MHonArc, Updated Tue Jun 19 16:40:02 2012