mailr4951 - /branches/N_state_model/maths_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 11, 2008 - 16:42:
Author: bugman
Date: Mon Feb 11 16:42:11 2008
New Revision: 4951

URL: http://svn.gna.org/viewcvs/relax?rev=4951&view=rev
Log:
The maths_fns code now uses the 'full_in_ref_frame' variable.


Modified:
    branches/N_state_model/maths_fns/n_state_model.py

Modified: branches/N_state_model/maths_fns/n_state_model.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/N_state_model/maths_fns/n_state_model.py?rev=4951&r1=4950&r2=4951&view=diff
==============================================================================
--- branches/N_state_model/maths_fns/n_state_model.py (original)
+++ branches/N_state_model/maths_fns/n_state_model.py Mon Feb 11 16:42:11 2008
@@ -31,7 +31,7 @@
 class N_state_opt:
     """Class containing the target function of the optimisation of the 
N-state model."""
 
-    def __init__(self, N=None, init_params=None, full_tensors=None, 
red_data=None, red_errors=None):
+    def __init__(self, N=None, init_params=None, full_tensors=None, 
red_data=None, red_errors=None, full_in_ref_frame=None):
         """Set up the class instance for optimisation.
 
         All constant data required for the N-state model are initialised 
here.
@@ -61,6 +61,7 @@
         self.num_tensors = len(self.full_tensors)
         self.red_data = red_data
         self.red_errors = red_errors
+        self.full_in_ref_frame = full_in_ref_frame
 
         # Initialise some empty numpy objects for storage of:
         # R:  the transient rotation matricies.
@@ -111,7 +112,13 @@
 
             # Back-calculate the reduced tensors for sum element c and add 
these to red_bc.
             for i in xrange(self.num_tensors):
-                self.red_bc[i] = self.red_bc[i]  +  pc * dot(self.RT[c], 
dot(self.full_tensors[i], self.R[c]))
+                # Normal RT.X.R rotation.
+                if self.full_in_ref_frame[i]:
+                    self.red_bc[i] = self.red_bc[i]  +  pc * dot(self.RT[c], 
dot(self.full_tensors[i], self.R[c]))
+
+                # Inverse R.X.RT rotation.
+                else:
+                    self.red_bc[i] = self.red_bc[i]  +  pc * dot(self.R[c], 
dot(self.full_tensors[i], self.RT[c]))
 
         # 5D vectorise the back-calculated tensors (create red_bc_vector 
from red_bc).
         for i in xrange(self.num_tensors):




Related Messages


Powered by MHonArc, Updated Mon Feb 11 18:00:18 2008