Author: bugman Date: Mon Dec 9 11:13:17 2013 New Revision: 21885 URL: http://svn.gna.org/viewcvs/relax?rev=21885&view=rev Log: Created the Relax_disp.test_ns_r1rho_3site_linear system test. This is for the 'NS R1rho 3-site' and 'NS R1rho 3-site linear' dispersion models. This follows the tutorial for adding relaxation dispersion models at: http://wiki.nmr-relax.com/Tutorial_for_adding_relaxation_dispersion_models_to_relax#The_test_suite Added: trunk/test_suite/system_tests/scripts/relax_disp/ns_r1rho_3site_linear.py - copied, changed from r21883, trunk/test_suite/shared_data/dispersion/ns_r1rho_3site_linear/relax_results/solution.py Modified: trunk/test_suite/system_tests/relax_disp.py Modified: trunk/test_suite/system_tests/relax_disp.py URL: http://svn.gna.org/viewcvs/relax/trunk/test_suite/system_tests/relax_disp.py?rev=21885&r1=21884&r2=21885&view=diff ============================================================================== --- trunk/test_suite/system_tests/relax_disp.py (original) +++ trunk/test_suite/system_tests/relax_disp.py Mon Dec 9 11:13:17 2013 @@ -2440,6 +2440,16 @@ self.assertAlmostEqual(cdp.mol[0].res[0].spin[1].chi2, 0.0, 3) + def test_ns_r1rho_3site_linear(self): + """Compare the 'NS R1rho 3-site linear' dispersion model to synthetic data from cpmg_fit.""" + + # Execute the script. + self.interpreter.run(script_file=status.install_path + sep+'test_suite'+sep+'system_tests'+sep+'scripts'+sep+'relax_disp'+sep+'ns_r1rho_3site_linear.py') + + # Check the chi-squared value. + self.assertAlmostEqual(cdp.mol[0].res[0].spin[0].chi2, 0.0, 3) + + def test_r2eff_read(self): """Test the operation of the relax_disp.r2eff_read user function.""" Copied: trunk/test_suite/system_tests/scripts/relax_disp/ns_r1rho_3site_linear.py (from r21883, trunk/test_suite/shared_data/dispersion/ns_r1rho_3site_linear/relax_results/solution.py) URL: http://svn.gna.org/viewcvs/relax/trunk/test_suite/system_tests/scripts/relax_disp/ns_r1rho_3site_linear.py?p2=trunk/test_suite/system_tests/scripts/relax_disp/ns_r1rho_3site_linear.py&p1=trunk/test_suite/shared_data/dispersion/ns_r1rho_3site_linear/relax_results/solution.py&r1=21883&r2=21885&rev=21885&view=diff ============================================================================== --- trunk/test_suite/shared_data/dispersion/ns_r1rho_3site_linear/relax_results/solution.py (original) +++ trunk/test_suite/system_tests/scripts/relax_disp/ns_r1rho_3site_linear.py Mon Dec 9 11:13:17 2013 @@ -1,14 +1,18 @@ -"""Compare the synthetic cpmg_fit data to the relax solution. +"""Compare the synthetic cpmg_fit data to the relax solution.""" -To run this, type: - -$ rm -f solution.log; ../../../../../relax --tee solution.log solution.py -""" +# Python module imports. +from os import sep # relax module imports. +from data_store import Relax_data_store; ds = Relax_data_store() from lib.nmr import frequency_to_ppm from specific_analyses.relax_disp.disp_data import generate_r20_key from specific_analyses.relax_disp.variables import EXP_TYPE_R1RHO +from status import Status; status = Status() + + +# The path to the data files. +DATA_PATH = status.install_path + sep+'test_suite'+sep+'shared_data'+sep+'dispersion'+sep+'ns_r1rho_3site_linear' # Create a data pipe. @@ -85,11 +89,11 @@ relax_disp.spin_lock_offset(spectrum_id=new_id, offset=-frequency_to_ppm(frq=offset, B0=H_frq, isotope='15N')) # Read the R2eff data. - relax_disp.r2eff_read_spin(id=id, file=file, dir='..', spin_id=':1', offset_col=6, data_col=10, error_col=9) + relax_disp.r2eff_read_spin(id=id, file=file, dir=DATA_PATH, spin_id=':1', offset_col=6, data_col=10, error_col=9) # Load the R1 data. -relax_data.read(ri_id='600MHz', ri_type='R1', frq=600e6, file='R1_600MHz.out', dir='..', mol_name_col=1, res_num_col=2, res_name_col=3, spin_num_col=4, spin_name_col=5, data_col=6, error_col=7) -relax_data.read(ri_id='800MHz', ri_type='R1', frq=800e6, file='R1_800MHz.out', dir='..', mol_name_col=1, res_num_col=2, res_name_col=3, spin_num_col=4, spin_name_col=5, data_col=6, error_col=7) +relax_data.read(ri_id='600MHz', ri_type='R1', frq=600e6, file='R1_600MHz.out', dir=DATA_PATH, mol_name_col=1, res_num_col=2, res_name_col=3, spin_num_col=4, spin_name_col=5, data_col=6, error_col=7) +relax_data.read(ri_id='800MHz', ri_type='R1', frq=800e6, file='R1_800MHz.out', dir=DATA_PATH, mol_name_col=1, res_num_col=2, res_name_col=3, spin_num_col=4, spin_name_col=5, data_col=6, error_col=7) # Change the model. relax_disp.select_model('NS R1rho 3-site') @@ -117,12 +121,8 @@ # Calculate. calc() -# Minimisation. -grid_search(inc=7) -minimise('simplex', constraints=True) - # Plot the dispersion curves. -relax_disp.plot_disp_curves(dir='.', num_points=100, extend=0, force=True) +relax_disp.plot_disp_curves(dir=ds.tmpdir, num_points=100, extend=0, force=True) # Save the results. -state.save('state', dir='.', compress_type=1, force=True) +state.save('state', dir=ds.tmpdir, compress_type=1, force=True)