Author: bugman Date: Wed Nov 17 16:45:32 2010 New Revision: 11668 URL: http://svn.gna.org/viewcvs/relax?rev=11668&view=rev Log: Some rotation matrix check fixes for the diffusion tensor unit tests. Modified: 1.3/test_suite/unit_tests/_data/test_diff_tensor.py Modified: 1.3/test_suite/unit_tests/_data/test_diff_tensor.py URL: http://svn.gna.org/viewcvs/relax/1.3/test_suite/unit_tests/_data/test_diff_tensor.py?rev=11668&r1=11667&r2=11668&view=diff ============================================================================== --- 1.3/test_suite/unit_tests/_data/test_diff_tensor.py (original) +++ 1.3/test_suite/unit_tests/_data/test_diff_tensor.py Wed Nov 17 16:45:32 2010 @@ -22,11 +22,12 @@ # Python module imports. from math import cos, pi, sin -from numpy import array, dot, transpose +from numpy import array, dot, float64, transpose, zeros from unittest import TestCase # relax module imports. from data.diff_tensor import DiffTensorData, DiffTensorSimList +from maths_fns.rotation_matrix import two_vect_to_R from relax_errors import RelaxError @@ -47,16 +48,21 @@ # Matrices. if Dpar > Dper: + axis = array([0, 0, 1], float64) tensor_diag = array([[ Dper, 0.0, 0.0], [ 0.0, Dper, 0.0], [ 0.0, 0.0, Dpar]]) else: + axis = array([1, 0, 0], float64) tensor_diag = array([[ Dpar, 0.0, 0.0], [ 0.0, Dper, 0.0], [ 0.0, 0.0, Dper]]) - rotation = array([[ cos(theta) * cos(phi), -sin(phi), sin(theta) * cos(phi) ], - [ cos(theta) * sin(phi), cos(phi), sin(theta) * sin(phi) ], - [ -sin(theta), 0.0, cos(theta) ]]) + + # The rotation. + rotation = zeros((3, 3), float64) + two_vect_to_R(Dpar_unit, axis, rotation) + + # The diffusion tensor. tensor = dot(rotation, dot(tensor_diag, transpose(rotation))) # Return the objects. @@ -87,6 +93,7 @@ # Set the diffusion type. self.diff_data.type = 'spheroid' + self.diff_data.spheroid_type = 'oblate' # Set the MC sim diffusion parameter lists. self.diff_data.tm_sim = DiffTensorSimList('tm', self.diff_data) @@ -159,6 +166,7 @@ # Set the diffusion type. self.diff_data.type = 'spheroid' + self.diff_data.spheroid_type = 'prolate' # Set the diffusion parameters. self.diff_data.tm_err = tm @@ -204,6 +212,7 @@ # Set the diffusion type. self.diff_data.type = 'spheroid' + self.diff_data.spheroid_type = 'prolate' # Set the diffusion parameters. self.diff_data.tm = tm @@ -255,6 +264,7 @@ # Set the diffusion type. self.diff_data.type = 'spheroid' + self.diff_data.spheroid_type = 'prolate' # Set the MC sim diffusion parameter lists. self.diff_data.tm_sim = DiffTensorSimList('tm', self.diff_data)