mailr8800 - /1.3/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 February 15, 2009 - 12:50:
Author: bugman
Date: Sun Feb 15 12:50:39 2009
New Revision: 8800

URL: http://svn.gna.org/viewcvs/relax?rev=8800&view=rev
Log:
Debugged the __minimise_bc_data() method.

The calculated Q-factors for the RDC and PCS were completely incorrect!


Modified:
    1.3/specific_fns/n_state_model.py

Modified: 1.3/specific_fns/n_state_model.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/specific_fns/n_state_model.py?rev=8800&r1=8799&r2=8800&view=diff
==============================================================================
--- 1.3/specific_fns/n_state_model.py (original)
+++ 1.3/specific_fns/n_state_model.py Sun Feb 15 12:50:39 2009
@@ -400,11 +400,8 @@
 
         # Loop over each alignment.
         for i in xrange(model.num_align):
-            # Indices.
-            pcs_index = 0
-            rdc_index = 0
-
             # Spin loop.
+            data_index = 0
             for spin in spin_loop():
                 # Skip deselected spins.
                 if not spin.select:
@@ -414,30 +411,23 @@
                 if hasattr(spin, 'pcs'):
                     # Initialise the data structure if necessary.
                     if not hasattr(spin, 'pcs_bc'):
-                        spin.pcs_bc = []
+                        spin.pcs_bc = [None]*model.num_align
 
                     # Append the back calculated PCS (in ppm).
-                    spin.pcs_bc.append(model.deltaij_theta[i, pcs_index]*1e6)
-
-                    # Increment the RDC index.
-                    pcs_index = pcs_index + 1
+                    spin.pcs_bc[i] = model.deltaij_theta[i, data_index] * 1e6
 
                 # Spins with RDC data.
                 if hasattr(spin, 'rdc') and hasattr(spin, 'xh_vect'):
                     # Initialise the data structure if necessary.
                     if not hasattr(spin, 'rdc_bc'):
-                        spin.rdc_bc = []
-
-                    # No RDC.
-                    if spin.rdc[i] == None:
-                        spin.rdc_bc.append(None)
-                        continue
+                        spin.rdc_bc = [None] * model.num_align
 
                     # Append the back calculated PCS.
-                    spin.rdc_bc.append(model.Dij_theta[i, rdc_index])
-
-                    # Increment the RDC index.
-                    rdc_index = rdc_index + 1
+                    spin.rdc_bc[i] = 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')):
+                    data_index = data_index + 1
 
 
     def __minimise_setup_pcs(self):




Related Messages


Powered by MHonArc, Updated Sun Feb 15 13:00:04 2009