Author: bugman Date: Tue Jan 28 11:23:50 2014 New Revision: 22056 URL: http://svn.gna.org/viewcvs/relax?rev=22056&view=rev Log: Fixes for the calculation of the frame order matrix in the test data generation base script. The matrix generation now handles multiple modes of motion correctly. The total rotation matrix is constructed when looping over the modes by using the dot product of the individual rotation to the total, and then this is used to create the outer product, summed over all states. Modified: branches/double_rotor/test_suite/shared_data/frame_order/cam/generate_base.py Modified: branches/double_rotor/test_suite/shared_data/frame_order/cam/generate_base.py URL: http://svn.gna.org/viewcvs/relax/branches/double_rotor/test_suite/shared_data/frame_order/cam/generate_base.py?rev=22056&r1=22055&r2=22056&view=diff ============================================================================== --- branches/double_rotor/test_suite/shared_data/frame_order/cam/generate_base.py (original) +++ branches/double_rotor/test_suite/shared_data/frame_order/cam/generate_base.py Tue Jan 28 11:23:50 2014 @@ -24,7 +24,7 @@ # Python module imports. from math import pi -from numpy import array, cross, dot, float16, float64, transpose, zeros +from numpy import array, cross, dot, eye, float16, float64, transpose, zeros from numpy.linalg import norm from os import getcwd, sep import sys @@ -206,6 +206,9 @@ # The progress meter. self._progress(global_index) + # Total rotation matrix (for construction of the frame order matrix). + total_R = eye(3) + # Loop over each motional mode. for motion_index in range(self.MODES): # Generate the distribution specific rotation. @@ -225,18 +228,21 @@ a, b, g = R_to_euler_zyz(self.R) rot_file.write('%10.7f %10.7f %10.7f\n' % (a, b, g)) - # The frame order matrix component. - self.daeg += kron_prod(self.R, self.R) - # Rotate the structure for the PDB distribution. if self.DIST_PDB: self.interpreter.structure.rotate(R=self.R, origin=self.PIVOT[motion_index], model=global_index+1) + # Contribution to the total rotation. + total_R = dot(self.R, total_R) + + # The frame order matrix component. + self.daeg += kron_prod(total_R, total_R) + # Print out. sys.stdout.write('\n\n') # Frame order matrix averaging. - self.daeg = self.daeg / self.N + self.daeg = self.daeg / self.N**self.MODES # Write out the frame order matrix. file = open(self.save_path+sep+'frame_order_matrix', 'w')