mailr7111 - /branches/rdc_analysis/specific_fns/n_state_model.py


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

Header


Content

Posted by edward on August 08, 2008 - 11:05:
Author: bugman
Date: Fri Aug  8 10:33:31 2008
New Revision: 7111

URL: http://svn.gna.org/viewcvs/relax?rev=7111&view=rev
Log:
Modified the __update_model() to handle both RDCs and PCSs.


Modified:
    branches/rdc_analysis/specific_fns/n_state_model.py

Modified: branches/rdc_analysis/specific_fns/n_state_model.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/rdc_analysis/specific_fns/n_state_model.py?rev=7111&r1=7110&r2=7111&view=diff
==============================================================================
--- branches/rdc_analysis/specific_fns/n_state_model.py (original)
+++ branches/rdc_analysis/specific_fns/n_state_model.py Fri Aug  8 10:33:31 
2008
@@ -309,13 +309,25 @@
                 cdp.gamma = [None] * cdp.N
 
         # Determine the data type.
-        data_type = self.__base_data_types()
+        data_types = self.__base_data_types()
 
         # Set up alignment tensors for each alignment.
-        if data_type == 'rdc' and not hasattr(cdp, 'align_tensors'):
-            # Loop over the alignments.
-            for align in cdp.rdc_ids:
-                generic_fns.align_tensor.init(tensor=align, params=[0.0, 
0.0, 0.0, 0.0, 0.0])
+        if 'rdc' in data_types or 'pcs' in data_types:
+            # Loop over the RDC and PCS ids.
+            for id in cdp.rdc_ids+cdp.pcs_ids:
+                # No tensors initialised.
+                if not hasattr(cdp, 'align_tensors'):
+                    generic_fns.align_tensor.init(tensor=id, params=[0.0, 
0.0, 0.0, 0.0, 0.0])
+
+                # Find if the tensor corresponding to the id exists.
+                exists = False
+                for tensor in cdp.align_tensors:
+                    if id == tensor.name:
+                        exists = True
+
+                # Initialise the tensor.
+                if not exists:
+                    generic_fns.align_tensor.init(tensor=id, params=[0.0, 
0.0, 0.0, 0.0, 0.0])
 
 
     def __linear_constraints(self, data_type=None, scaling_matrix=None):




Related Messages


Powered by MHonArc, Updated Fri Aug 08 11:20:17 2008