Author: bugman Date: Thu Oct 10 15:48:47 2013 New Revision: 21056 URL: http://svn.gna.org/viewcvs/relax?rev=21056&view=rev Log: Added support for the new 'dwH' dispersion parameter. This is needed for the 'MQ NS CPMG 2-site' model support. This follows the tutorial for adding relaxation dispersion models at: http://wiki.nmr-relax.com/Tutorial_for_adding_relaxation_dispersion_models_to_relax#Adding_support_for_the_parameters. Modified: branches/relax_disp/specific_analyses/relax_disp/api.py branches/relax_disp/specific_analyses/relax_disp/optimisation.py branches/relax_disp/specific_analyses/relax_disp/parameters.py Modified: branches/relax_disp/specific_analyses/relax_disp/api.py URL: http://svn.gna.org/viewcvs/relax/branches/relax_disp/specific_analyses/relax_disp/api.py?rev=21056&r1=21055&r2=21056&view=diff ============================================================================== --- branches/relax_disp/specific_analyses/relax_disp/api.py (original) +++ branches/relax_disp/specific_analyses/relax_disp/api.py Thu Oct 10 15:48:47 2013 @@ -90,6 +90,7 @@ self.PARAMS.add('phi_ex_C', scope='spin', default=5.0, desc='The fast exchange factor between sites A and C (ppm^2)', set='params', py_type=float, grace_string='\\xF\\B\\sex,C\\N (ppm\\S2\\N)', err=True, sim=True) self.PARAMS.add('padw2', scope='spin', default=1.0, desc='The pA.dw**2 value (ppm^2)', set='params', py_type=float, grace_string='\\qp\\sA\\N.\\xDw\\B\\S2\\N\\Q (ppm\\S2\\N)', err=True, sim=True) self.PARAMS.add('dw', scope='spin', default=0.0, desc='The chemical shift difference between states A and B (in ppm)', set='params', py_type=float, grace_string='\\q\\xDw\\B\\Q (ppm)', err=True, sim=True) + self.PARAMS.add('dwH', scope='spin', default=0.0, desc='The proton chemical shift difference between states A and B (in ppm)', set='params', py_type=float, grace_string='\\q\\xDw\\B\\sH\\N\\Q (ppm)', err=True, sim=True) self.PARAMS.add('kex', scope='spin', default=10000.0, desc='The exchange rate', set='params', py_type=float, grace_string='\\qk\\sex\\N\\Q (rad.s\\S-1\\N)', err=True, sim=True) self.PARAMS.add('kB', scope='spin', default=10000.0, desc='Approximate chemical exchange rate constant between sites A and B (rad.s^-1)', set='params', py_type=float, grace_string='\\qk\\sB\\N\\Q (rad.s\\S-1\\N)', err=True, sim=True) self.PARAMS.add('kC', scope='spin', default=10000.0, desc='Approximate chemical exchange rate constant between sites A and C (rad.s^-1)', set='params', py_type=float, grace_string='\\qk\\sC\\N\\Q (rad.s\\S-1\\N)', err=True, sim=True) @@ -818,6 +819,7 @@ _table.add_row(["The pA.pB.dw**2 parameter of state C (ppm^2)", "'phi_ex_C'", "5.0"]) _table.add_row(["The pA.dw**2 parameter (ppm^2)", "'padw2'", "1.0"]) _table.add_row(["Chemical shift difference between states A and B (ppm)", "'dw'", "0.0"]) + _table.add_row(["Proton chemical shift difference between states A and B (ppm)", "'dwH'", "0.0"]) _table.add_row(["Exchange rate (rad/s)", "'kex'", "10000.0"]) _table.add_row(["Exchange rate between sites A and B (rad/s)", "'kB'", "10000.0"]) _table.add_row(["Exchange rate between sites A and C (rad/s)", "'kC'", "10000.0"]) @@ -1142,6 +1144,7 @@ _table.add_row(["The pA.pB.dw**2 parameter (ppm^2)", "'phi_ex'"]) _table.add_row(["The pA.dw**2 parameter (ppm^2)", "'padw2'"]) _table.add_row(["Chemical shift difference between states A and B (ppm)", "'dw'"]) + _table.add_row(["Proton chemical shift difference between states A and B (ppm)", "'dwH'"]) _table.add_row(["Exchange rate (rad/s)", "'kex'"]) _table.add_row(["Exchange rate from state A to state B (rad/s)", "'k_AB'"]) _table.add_row(["Exchange rate from state B to state A (rad/s)", "'k_BA'"]) Modified: branches/relax_disp/specific_analyses/relax_disp/optimisation.py URL: http://svn.gna.org/viewcvs/relax/branches/relax_disp/specific_analyses/relax_disp/optimisation.py?rev=21056&r1=21055&r2=21056&view=diff ============================================================================== --- branches/relax_disp/specific_analyses/relax_disp/optimisation.py (original) +++ branches/relax_disp/specific_analyses/relax_disp/optimisation.py Thu Oct 10 15:48:47 2013 @@ -122,7 +122,7 @@ upper.append(10.0) # Chemical shift difference between states A and B. - elif spin.params[i] == 'dw': + elif spin.params[i] in ['dw', 'dwH']: lower.append(0.0) upper.append(10.0) Modified: branches/relax_disp/specific_analyses/relax_disp/parameters.py URL: http://svn.gna.org/viewcvs/relax/branches/relax_disp/specific_analyses/relax_disp/parameters.py?rev=21056&r1=21055&r2=21056&view=diff ============================================================================== --- branches/relax_disp/specific_analyses/relax_disp/parameters.py (original) +++ branches/relax_disp/specific_analyses/relax_disp/parameters.py Thu Oct 10 15:48:47 2013 @@ -103,7 +103,7 @@ scaling_matrix[param_index, param_index] = 1 # Chemical shift difference between states A and B scaling. - elif param_name == 'dw': + elif param_name in ['dw', 'dwH']: scaling_matrix[param_index, param_index] = 1 # The population of state A. @@ -533,7 +533,7 @@ j += 1 # Chemical exchange difference (dw >= 0). - elif param_name == 'dw': + elif param_name in ['dw', 'dwH']: A.append(zero_array * 0.0) A[j][param_index] = 1.0 b.append(0.0) @@ -657,7 +657,7 @@ # Yield the data. yield 'r2b', param_index, spin_index, frq_index - # Then the chemical shift difference parameters 'phi_ex', 'phi_ex_B', 'phi_ex_C', 'padw2' and 'dw' (one per spin). + # Then the chemical shift difference parameters 'phi_ex', 'phi_ex_B', 'phi_ex_C', 'padw2', 'dw' and 'dwH' (one per spin). for spin_index in range(len(spins)): # Yield the data. if 'phi_ex' in spins[spin_index].params: @@ -675,10 +675,13 @@ if 'dw' in spins[spin_index].params: param_index += 1 yield 'dw', param_index, spin_index, None + if 'dwH' in spins[spin_index].params: + param_index += 1 + yield 'dwH', param_index, spin_index, None # All other parameters (one per spin cluster). for param in spins[0].params: - if not param in ['r2', 'r2a', 'r2b', 'phi_ex', 'phi_ex_B', 'phi_ex_C', 'padw2', 'dw']: + if not param in ['r2', 'r2a', 'r2b', 'phi_ex', 'phi_ex_B', 'phi_ex_C', 'padw2', 'dw', 'dwH']: param_index += 1 yield param, param_index, None, None @@ -774,7 +777,7 @@ raise RelaxError("The number of parameters for each spin in the cluster are not the same.") # Count the number of spin specific parameters for all spins. - spin_params = ['r2', 'r2a', 'r2b', 'phi_ex', 'phi_ex_B', 'phi_ex_C', 'padw2', 'dw'] + spin_params = ['r2', 'r2a', 'r2b', 'phi_ex', 'phi_ex_B', 'phi_ex_C', 'padw2', 'dw', 'dwH'] num = 0 for spin in spins: for i in range(len(spin.params)):