mailr14867 - /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 October 12, 2011 - 19:32:
Author: bugman
Date: Wed Oct 12 19:32:04 2011
New Revision: 14867

URL: http://svn.gna.org/viewcvs/relax?rev=14867&view=rev
Log:
Some last fixes, hopefully, for the N-state model code.


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=14867&r1=14866&r2=14867&view=diff
==============================================================================
--- 1.3/specific_fns/n_state_model.py (original)
+++ 1.3/specific_fns/n_state_model.py Wed Oct 12 19:32:04 2011
@@ -759,7 +759,6 @@
             return
 
         # Loop over each alignment.
-        align_index = 0
         for i in xrange(len(cdp.align_ids)):
             # Fixed tensor.
             if cdp.align_tensors[i].fixed:
@@ -790,7 +789,7 @@
                         spin.pcs_bc = {}
 
                     # Add the back calculated PCS (in ppm).
-                    spin.pcs_bc[align_id] = model.deltaij_theta[align_index, 
data_index] * 1e6
+                    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')):
@@ -799,14 +798,11 @@
                         spin.rdc_bc = {}
 
                     # Append the back calculated PCS.
-                    spin.rdc_bc[align_id] = model.Dij_theta[align_index, 
data_index]
+                    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
-
-            # Increment the alignment index.
-            align_index += 1
 
 
     def _minimise_setup_atomic_pos(self):
@@ -2145,6 +2141,9 @@
         if isNaN(func):
             raise RelaxNaNError('chi-squared')
 
+        # Make a last function call to update the back-calculated RDC and 
PCS structures to the optimal values.
+        chi2 = model.func(param_vector)
+
         # Scaling.
         if scaling:
             param_vector = dot(scaling_matrix, param_vector)




Related Messages


Powered by MHonArc, Updated Thu Oct 13 18:40:02 2011