Author: semor Date: Tue Jul 8 07:06:37 2008 New Revision: 6835 URL: http://svn.gna.org/viewcvs/relax?rev=6835&view=rev Log: Added a script to test jw_mapping. This one is based on the same code for testing the consistency testing code. Added: 1.3/test_suite/system_tests/scripts/jw_mapping.py Modified: 1.3/test_suite/system_tests/jw_mapping.py Modified: 1.3/test_suite/system_tests/jw_mapping.py URL: http://svn.gna.org/viewcvs/relax/1.3/test_suite/system_tests/jw_mapping.py?rev=6835&r1=6834&r2=6835&view=diff ============================================================================== --- 1.3/test_suite/system_tests/jw_mapping.py (original) +++ 1.3/test_suite/system_tests/jw_mapping.py Tue Jul 8 07:06:37 2008 @@ -119,3 +119,10 @@ for res in residue_loop(): self.assertEqual(res.spin[0].r, NH_BOND_LENGTH) self.assertEqual(res.spin[0].csa, N15_CSA) + + + def test_mapping(self): + """Test a complete jw mapping run using a script.""" + + # Execute the script. + self.relax.interpreter.run(script_file=sys.path[-1] + '/test_suite/system_tests/scripts/jw_mapping.py') Added: 1.3/test_suite/system_tests/scripts/jw_mapping.py URL: http://svn.gna.org/viewcvs/relax/1.3/test_suite/system_tests/scripts/jw_mapping.py?rev=6835&view=auto ============================================================================== --- 1.3/test_suite/system_tests/scripts/jw_mapping.py (added) +++ 1.3/test_suite/system_tests/scripts/jw_mapping.py Tue Jul 8 07:06:37 2008 @@ -1,0 +1,46 @@ +"""Script for jw_mapping testing.""" + +# Python module imports. +from os import devnull +import sys + +# Create the run. +name = 'jw_mapping' +pipe.create(name, 'jw') + +# Load the sequence. +sequence.read(sys.path[-1] + '/test_suite/system_tests/data/jw_mapping/noe.dat') + +# Load the relaxation data. +relax_data.read('R1', '600', 600.0 * 1e6, sys.path[-1] + '/test_suite/system_tests/data/jw_mapping/R1.dat') +relax_data.read('R2', '600', 600.0 * 1e6, sys.path[-1] + '/test_suite/system_tests/data/jw_mapping/R2.dat') +relax_data.read('NOE', '600', 600.0 * 1e6, sys.path[-1] + '/test_suite/system_tests/data/jw_mapping/noe.dat') + +# Set the nuclei types +value.set('15N', 'heteronucleus') +value.set('1H', 'proton') + +# Set the bond length and CSA values. +value.set(1.02 * 1e-10, 'bond_length') +value.set(-172 * 1e-6, 'csa') + +# Set the frequency. +jw_mapping.set_frq(frq=600.0 * 1e6) + +# Jw mapping. +calc() + +# Monte Carlo simulations. +monte_carlo.setup(number=500) +monte_carlo.create_data() +calc() +monte_carlo.error_analysis() + +# Create grace files. +grace.write(y_data_type='j0', file=devnull, force=True) +grace.write(y_data_type='jwx', file=devnull, force=True) +grace.write(y_data_type='jwh', file=devnull, force=True) + +# Finish. +results.write(file=devnull, force=True) +state.save(devnull, force=True)