mailr11299 - in /1.3/test_suite/system_tests: n_state_model.py scripts/n_state_model/A_to_chi.py


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

Header


Content

Posted by edward on July 15, 2010 - 13:19:
Author: bugman
Date: Thu Jul 15 13:19:11 2010
New Revision: 11299

URL: http://svn.gna.org/viewcvs/relax?rev=11299&view=rev
Log:
Added a system test checking the conversion of alignment tensor to chi tensor.


Added:
    1.3/test_suite/system_tests/scripts/n_state_model/A_to_chi.py
Modified:
    1.3/test_suite/system_tests/n_state_model.py

Modified: 1.3/test_suite/system_tests/n_state_model.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/test_suite/system_tests/n_state_model.py?rev=11299&r1=11298&r2=11299&view=diff
==============================================================================
--- 1.3/test_suite/system_tests/n_state_model.py (original)
+++ 1.3/test_suite/system_tests/n_state_model.py Thu Jul 15 13:19:11 2010
@@ -139,6 +139,17 @@
 
         # Test the chi-squared.
         self.assertAlmostEqual(cdp.chi2, 3.15009916529e-32)
+
+
+    def test_A_to_chi(self):
+        """Test the conversion of the alignment tensor to the chi tensor."""
+
+        # Execute the script.
+        self.interpreter.run(script_file=__main__.install_path + 
sep+'test_suite'+sep+'system_tests'+sep+'scripts'+sep+'n_state_model'+sep+'A_to_chi.py')
+
+        # Test the optimised values.
+        for i in range(3):
+            self.assertAlmostEqual(cdp.chi[i, i] * 1e32, cdp.chi_ref[i] * 
1e32, 2)
 
 
     def test_align_fit(self):

Added: 1.3/test_suite/system_tests/scripts/n_state_model/A_to_chi.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/test_suite/system_tests/scripts/n_state_model/A_to_chi.py?rev=11299&view=auto
==============================================================================
--- 1.3/test_suite/system_tests/scripts/n_state_model/A_to_chi.py (added)
+++ 1.3/test_suite/system_tests/scripts/n_state_model/A_to_chi.py Thu Jul 15 
13:19:11 2010
@@ -1,0 +1,29 @@
+from physical_constants import NH_BOND_LENGTH_RDC, dipolar_constant, g15N, 
g1H
+from generic_fns.align_tensor import calc_chi_tensor
+
+
+# The data pipe.
+pipe.create('AtoX', 'N-state')
+
+# The dipolar constant.
+const = 3.0 / (2.0*pi) * dipolar_constant(g15N, g1H, NH_BOND_LENGTH_RDC)
+
+# The tensor.
+tensor = 'A'
+align_tensor.init(tensor, (5.090/const,  12.052/const, 0, 0, 0), 
param_types=2)
+
+# The temperature.
+temperature(id=tensor, temp=298)
+
+# The frequency.
+frq.set(id=tensor, frq=900.0 * 1e6)
+
+# The magnetic susceptibility tensor.
+cdp.chi = calc_chi_tensor(cdp.align_tensors[0].A, cdp.frq[tensor], 
cdp.temperature[tensor])
+print(cdp.chi)
+
+cdp.chi_ref = [2.729e-32,   6.462e-32,  -9.191e-32]
+
+# Comp.
+for i in range(3):
+    print("Chi eigenvalue ratio %i: %s " % (i+1, cdp.chi_ref[i] / cdp.chi[i, 
i]))




Related Messages


Powered by MHonArc, Updated Thu Jul 15 13:40:02 2010