Author: bugman Date: Mon Aug 9 14:28:45 2010 New Revision: 11448 URL: http://svn.gna.org/viewcvs/relax?rev=11448&view=rev Log: Added 4 frame order unit tests checking the half cone frame order matrix. Modified: 1.3/test_suite/unit_tests/_maths_fns/test_frame_order_matrix_ops.py Modified: 1.3/test_suite/unit_tests/_maths_fns/test_frame_order_matrix_ops.py URL: http://svn.gna.org/viewcvs/relax/1.3/test_suite/unit_tests/_maths_fns/test_frame_order_matrix_ops.py?rev=11448&r1=11447&r2=11448&view=diff ============================================================================== --- 1.3/test_suite/unit_tests/_maths_fns/test_frame_order_matrix_ops.py (original) +++ 1.3/test_suite/unit_tests/_maths_fns/test_frame_order_matrix_ops.py Mon Aug 9 14:28:45 2010 @@ -69,6 +69,25 @@ self.I_disorder = zeros((9, 9), float64) for i, j, val in data: self.I_disorder[i, j] = val + + + # The half cone matrix. + data = [[0, 0, 1.0/3.0], + [4, 4, 1.0/3.0], + [8, 8, 1.0/3.0], + [0, 4, 1.0/3.0], + [4, 0, 1.0/3.0], + [0, 8, 1.0/3.0], + [8, 0, 1.0/3.0], + [4, 8, 1.0/3.0], + [8, 4, 1.0/3.0], + [1, 3, -0.25], + [3, 1, -0.25], + [1, 1, 0.25], + [3, 3, 0.25]] + self.f2_half_cone = zeros((9, 9), float64) + for i, j, val in data: + self.f2_half_cone[i, j] = val def setup_identity_free_rotor(self): @@ -123,6 +142,23 @@ self.assertAlmostEqual(f2[i, j], self.I_disorder[i, j]) + def test_compile_2nd_matrix_iso_cone_half_cone(self): + """Check if compile_2nd_matrix_iso_cone() can return the matrix for a half cone.""" + + # Calculate the frame order matrix. + f2 = compile_2nd_matrix_iso_cone(self.f2_temp, self.R_temp, 0.0, 0.0, 0.0, pi/2.0, pi) + + # Print outs. + print_frame_order_2nd_degree(self.f2_half_cone, "The half cone frame order matrix") + print_frame_order_2nd_degree(f2, "Compiled frame order") + + # Check the values. + for i in range(9): + for j in range(9): + print "Element %s, %s." % (i, j) + self.assertAlmostEqual(f2[i, j], self.f2_half_cone[i, j]) + + def test_compile_2nd_matrix_iso_cone_order(self): """Check if compile_2nd_matrix_iso_cone() can return the identity matrix for order.""" @@ -167,25 +203,50 @@ # Calculate the frame order matrix. f2 = compile_2nd_matrix_iso_cone_free_rotor(self.f2_temp, self.R_temp, z_axis, cone_axis, 0.0, 1.0, 0.0) - # Print outs. - print_frame_order_2nd_degree(self.I_disorder, "Free rotor identity for disorder") - print_frame_order_2nd_degree(f2, "Compiled frame order") - - # Check the values. - for i in range(9): - for j in range(9): - print "Element %s, %s." % (i, j) - self.assertAlmostEqual(f2[i, j], self.I_disorder[i, j]) - - - def test_compile_2nd_matrix_iso_cone_free_rotor_order(self): - """Check if compile_2nd_matrix_iso_cone_free_rotor() can return the identity matrix for order.""" + # Cannot differentiate full disorder from the half cone in this model! + f2_ref = self.f2_half_cone + + # Print outs. + print_frame_order_2nd_degree(self.I_disorder, "Identity for disorder") + print_frame_order_2nd_degree(f2_ref, "The half cone frame order matrix") + print_frame_order_2nd_degree(f2, "Compiled frame order") + + # Check the values. + for i in range(9): + for j in range(9): + print "Element %s, %s." % (i, j) + self.assertAlmostEqual(f2[i, j], f2_ref[i, j]) + + + def test_compile_2nd_matrix_iso_cone_free_rotor_half_cone(self): + """Check if compile_2nd_matrix_iso_cone() can return the matrix for a half cone.""" # Init. z_axis = array([0, 0, 1], float64) cone_axis = zeros(3, float64) # Calculate the frame order matrix. + f2 = compile_2nd_matrix_iso_cone_free_rotor(self.f2_temp, self.R_temp, z_axis, cone_axis, 0.0, 1.0, 0.0) + + # Print outs. + print_frame_order_2nd_degree(self.f2_half_cone, "The half cone frame order matrix") + print_frame_order_2nd_degree(f2, "Compiled frame order") + + # Check the values. + for i in range(9): + for j in range(9): + print "Element %s, %s." % (i, j) + self.assertAlmostEqual(f2[i, j], self.f2_half_cone[i, j]) + + + def test_compile_2nd_matrix_iso_cone_free_rotor_order(self): + """Check if compile_2nd_matrix_iso_cone_free_rotor() can return the identity matrix for order.""" + + # Init. + z_axis = array([0, 0, 1], float64) + cone_axis = zeros(3, float64) + + # Calculate the frame order matrix. f2 = compile_2nd_matrix_iso_cone_free_rotor(self.f2_temp, self.R_temp, z_axis, cone_axis, 0.0, 1.0, 1.0) # Print outs. @@ -216,6 +277,23 @@ self.assertAlmostEqual(f2[i, j], self.I_disorder[i, j]) + def test_compile_2nd_matrix_pseudo_ellipse_half_cone(self): + """Check if compile_2nd_matrix_pseudo_ellipse() can return the matrix for a half cone.""" + + # Calculate the frame order matrix. + f2 = compile_2nd_matrix_pseudo_ellipse(self.f2_temp, self.R_temp, 0.0, 0.0, 0.0, pi/2.0, pi/2.0, pi) + + # Print outs. + print_frame_order_2nd_degree(self.f2_half_cone, "The half cone frame order matrix") + print_frame_order_2nd_degree(f2, "Compiled frame order") + + # Check the values. + for i in range(9): + for j in range(9): + print "Element %s, %s." % (i, j) + self.assertAlmostEqual(f2[i, j], self.f2_half_cone[i, j]) + + def test_compile_2nd_matrix_pseudo_ellipse_order(self): """Check if compile_2nd_matrix_pseudo_ellipse() can return the identity matrix for order.""" @@ -240,7 +318,7 @@ f2 = compile_2nd_matrix_pseudo_ellipse_free_rotor(self.f2_temp, self.R_temp, 0.0, 0.0, 0.0, pi, pi) # Print outs. - print_frame_order_2nd_degree(self.I_disorder, "Free rotor identity for disorder") + print_frame_order_2nd_degree(self.I_disorder, "Identity for disorder") print_frame_order_2nd_degree(f2, "Compiled frame order") # Check the values. @@ -248,6 +326,23 @@ for j in range(9): print "Element %s, %s." % (i, j) self.assertAlmostEqual(f2[i, j], self.I_disorder[i, j]) + + + def test_compile_2nd_matrix_pseudo_ellipse_free_rotor_half_cone(self): + """Check if compile_2nd_matrix_pseudo_ellipse() can return the matrix for a half cone.""" + + # Calculate the frame order matrix. + f2 = compile_2nd_matrix_pseudo_ellipse_free_rotor(self.f2_temp, self.R_temp, 0.0, 0.0, 0.0, pi/2.0, pi/2.0) + + # Print outs. + print_frame_order_2nd_degree(self.f2_half_cone, "The half cone frame order matrix") + print_frame_order_2nd_degree(f2, "Compiled frame order") + + # Check the values. + for i in range(9): + for j in range(9): + print "Element %s, %s." % (i, j) + self.assertAlmostEqual(f2[i, j], self.f2_half_cone[i, j]) def test_compile_2nd_matrix_pseudo_ellipse_free_rotor_order(self):