mailr14939 - in /1.3/test_suite/system_tests: frame_order.py scripts/frame_order/cam/free_rotor2.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on October 27, 2011 - 12:48:
Author: bugman
Date: Thu Oct 27 12:48:01 2011
New Revision: 14939

URL: http://svn.gna.org/viewcvs/relax?rev=14939&view=rev
Log:
Created the Frame_order.test_cam_free_rotor2 system test.

This tests the free rotor frame order CaM test model where the axis is tilted 
from the pivot-CoM
axis.


Added:
    1.3/test_suite/system_tests/scripts/frame_order/cam/free_rotor2.py
      - copied, changed from r14933, 
1.3/test_suite/system_tests/scripts/frame_order/cam/free_rotor.py
Modified:
    1.3/test_suite/system_tests/frame_order.py

Modified: 1.3/test_suite/system_tests/frame_order.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/test_suite/system_tests/frame_order.py?rev=14939&r1=14938&r2=14939&view=diff
==============================================================================
--- 1.3/test_suite/system_tests/frame_order.py (original)
+++ 1.3/test_suite/system_tests/frame_order.py Thu Oct 27 12:48:01 2011
@@ -195,6 +195,49 @@
             self.assertAlmostEqual(angle, 0.0, 1)
 
 
+    def test_cam_free_rotor2(self):
+        """Test the second free rotor frame order model of CaM."""
+
+        # Execute the script.
+        self.interpreter.run(script_file=status.install_path + 
sep+'test_suite'+sep+'system_tests'+sep+'scripts'+sep+'frame_order'+sep+'cam'+sep+'free_rotor2.py')
+
+        # The base data.
+        pivot = array([ 37.254, 0.5, 16.7465])
+        com = array([ 26.83678091, -12.37906417,  28.34154128])
+        pivot_com_axis = com - pivot
+        rot_axis = array([ 0.59390169,  0.73425527, -0.16105115])
+
+        # The average position CoM.
+        ave_pivot_com_axis = ds['ave pos'].CoM - pivot
+
+        # The projection of the CoMs onto the rotation axis.
+        orig_proj = dot(pivot_com_axis, rot_axis)
+        ave_proj = dot(ave_pivot_com_axis, rot_axis)
+
+        # Check that the projections are equal.
+        self.assertAlmostEqual(orig_proj, ave_proj, 0)
+
+        # The rotation axis.
+        self.interpreter.pipe.switch('frame order')
+        spherical_vect = zeros(3, float64)
+        spherical_vect[0] = 1.0
+        spherical_vect[1] = cdp.axis_theta
+        spherical_vect[2] = cdp.axis_phi
+        cart_vect = zeros(3, float64)
+        spherical_to_cartesian(spherical_vect, cart_vect)
+        print("\nReal rotation axis:   %s" % repr(rot_axis))
+        print("Fitted rotation axis: %s" % repr(cart_vect))
+
+        # The dot product.
+        angle = acos(dot(cart_vect, rot_axis))
+
+        # Check the angle.
+        if angle > 3 and angle < 4:
+            self.assertAlmostEqual(angle, pi, 1)
+        else:
+            self.assertAlmostEqual(angle, 0.0, 1)
+
+
     def test_cam_rigid(self):
         """Test the rigid frame order model of CaM."""
 

Copied: 1.3/test_suite/system_tests/scripts/frame_order/cam/free_rotor2.py 
(from r14933, 
1.3/test_suite/system_tests/scripts/frame_order/cam/free_rotor.py)
URL: 
http://svn.gna.org/viewcvs/relax/1.3/test_suite/system_tests/scripts/frame_order/cam/free_rotor2.py?p2=1.3/test_suite/system_tests/scripts/frame_order/cam/free_rotor2.py&p1=1.3/test_suite/system_tests/scripts/frame_order/cam/free_rotor.py&r1=14933&r2=14939&rev=14939&view=diff
==============================================================================
--- 1.3/test_suite/system_tests/scripts/frame_order/cam/free_rotor.py 
(original)
+++ 1.3/test_suite/system_tests/scripts/frame_order/cam/free_rotor2.py Thu 
Oct 27 12:48:01 2011
@@ -40,7 +40,7 @@
 
         # The file paths.
         PATH_N_DOM = DATA_PATH
-        PATH_C_DOM = PATH_N_DOM+sep+'free_rotor'+sep
+        PATH_C_DOM = PATH_N_DOM+sep+'free_rotor2'+sep
 
         # Create the data pipe.
         pipe.create(pipe_name='frame order', pipe_type='frame order')




Related Messages


Powered by MHonArc, Updated Fri Oct 28 16:20:01 2011