Author: bugman Date: Thu Oct 10 16:21:31 2013 New Revision: 21061 URL: http://svn.gna.org/viewcvs/relax?rev=21061&view=rev Log: Added support for the MQ dispersion data types to the rest of relax. This is needed for the 'MQ NS CPMG 2-site' model, and the changes affect the dispersion data checks and the dispersion target functions. This follows the tutorial for adding relaxation dispersion models at: http://wiki.nmr-relax.com/Tutorial_for_adding_relaxation_dispersion_models_to_relax#Creating_a_new_experiment_type. Modified: branches/relax_disp/specific_analyses/relax_disp/checks.py branches/relax_disp/target_functions/relax_disp.py Modified: branches/relax_disp/specific_analyses/relax_disp/checks.py URL: http://svn.gna.org/viewcvs/relax/branches/relax_disp/specific_analyses/relax_disp/checks.py?rev=21061&r1=21060&r2=21061&view=diff ============================================================================== --- branches/relax_disp/specific_analyses/relax_disp/checks.py (original) +++ branches/relax_disp/specific_analyses/relax_disp/checks.py Thu Oct 10 16:21:31 2013 @@ -29,7 +29,7 @@ from dep_check import C_module_exp_fn from lib.errors import RelaxError, RelaxFuncSetupError, RelaxNoPeakIntensityError import specific_analyses -from specific_analyses.relax_disp.variables import EXP_TYPE_CPMG, EXP_TYPE_R1RHO +from specific_analyses.relax_disp.variables import EXP_TYPE_CPMG, EXP_TYPE_MQ_CPMG, EXP_TYPE_MQ_R1RHO, EXP_TYPE_R1RHO def check_c_modules(): @@ -60,12 +60,12 @@ # Check each spectrum ID. for id in cdp.spectrum_ids: # CPMG data. - if cdp.exp_type[id] == EXP_TYPE_CPMG: + if cdp.exp_type[id] in [EXP_TYPE_CPMG, EXP_TYPE_MQ_CPMG]: if id not in cdp.cpmg_frqs: raise RelaxError("The nu_CPMG frequency has not been set for the '%s' spectrum." % id) # R1rho data. - elif cdp.exp_type[id] == EXP_TYPE_R1RHO: + elif cdp.exp_type[id] in [EXP_TYPE_R1RHO, EXP_TYPE_MQ_R1RHO]: if id not in cdp.spin_lock_nu1: raise RelaxError("The spin-lock field strength has not been set for the '%s' spectrum." % id) Modified: branches/relax_disp/target_functions/relax_disp.py URL: http://svn.gna.org/viewcvs/relax/branches/relax_disp/target_functions/relax_disp.py?rev=21061&r1=21060&r2=21061&view=diff ============================================================================== --- branches/relax_disp/target_functions/relax_disp.py (original) +++ branches/relax_disp/target_functions/relax_disp.py Thu Oct 10 16:21:31 2013 @@ -44,7 +44,7 @@ from lib.dispersion.tsmfk01 import r2eff_TSMFK01 from lib.errors import RelaxError from target_functions.chi2 import chi2 -from specific_analyses.relax_disp.variables import EXP_TYPE_CPMG, EXP_TYPE_R1RHO, MODEL_CR72, MODEL_CR72_FULL, MODEL_DPL94, MODEL_IT99, MODEL_LIST_CPMG, MODEL_LIST_FULL, MODEL_LIST_R1RHO, MODEL_LM63, MODEL_LM63_3SITE, MODEL_M61, MODEL_M61B, MODEL_NOREX, MODEL_NS_CPMG_2SITE_3D, MODEL_NS_CPMG_2SITE_3D_FULL, MODEL_NS_CPMG_2SITE_EXPANDED, MODEL_NS_CPMG_2SITE_STAR, MODEL_NS_CPMG_2SITE_STAR_FULL, MODEL_NS_R1RHO_2SITE, MODEL_R2EFF, MODEL_TP02, MODEL_TSMFK01 +from specific_analyses.relax_disp.variables import EXP_TYPE_CPMG, EXP_TYPE_MQ_CPMG, EXP_TYPE_MQ_R1RHO, EXP_TYPE_R1RHO, MODEL_CR72, MODEL_CR72_FULL, MODEL_DPL94, MODEL_IT99, MODEL_LIST_CPMG, MODEL_LIST_FULL, MODEL_LIST_MQ_CPMG, MODEL_LIST_MQ_R1RHO, MODEL_LIST_R1RHO, MODEL_LM63, MODEL_LM63_3SITE, MODEL_M61, MODEL_M61B, MODEL_NOREX, MODEL_NS_CPMG_2SITE_3D, MODEL_NS_CPMG_2SITE_3D_FULL, MODEL_NS_CPMG_2SITE_EXPANDED, MODEL_NS_CPMG_2SITE_STAR, MODEL_NS_CPMG_2SITE_STAR_FULL, MODEL_NS_R1RHO_2SITE, MODEL_R2EFF, MODEL_TP02, MODEL_TSMFK01 class Dispersion: @@ -427,17 +427,21 @@ """ # The CPMG and R1rho single models. - if self.model in MODEL_LIST_CPMG + MODEL_LIST_R1RHO: + if self.model in MODEL_LIST_CPMG + MODEL_LIST_R1RHO + MODEL_LIST_MQ_CPMG + MODEL_LIST_MQ_R1RHO: # Remove the first dimension of the data structures. self.values = self.values[0] self.errors = self.errors[0] self.missing = self.missing[0] # Check that the data is correct. - if self.model != MODEL_NOREX and self.model in MODEL_LIST_CPMG and self.exp_types[0] == EXP_TYPE_R1RHO: - raise RelaxError("The '%s' CPMG model is not compatible with the R1rho experiment type." % self.model) - if self.model != MODEL_NOREX and self.model in MODEL_LIST_R1RHO and self.exp_types[0] == EXP_TYPE_CPMG: - raise RelaxError("The '%s' R1rho model is not compatible with the CPMG experiment type." % self.model) + if self.model != MODEL_NOREX and self.model in MODEL_LIST_CPMG and self.exp_types[0] != EXP_TYPE_CPMG: + raise RelaxError("The '%s' CPMG model is not compatible with the '%s' experiment type." % (self.model, self.exp_types[0])) + if self.model != MODEL_NOREX and self.model in MODEL_LIST_R1RHO and self.exp_types[0] != EXP_TYPE_R1RHO: + raise RelaxError("The '%s' R1rho model is not compatible with the '%s' experiment type." % (self.model, self.exp_types[0])) + if self.model != MODEL_NOREX and self.model in MODEL_LIST_MQ_CPMG and self.exp_types[0] != EXP_TYPE_MQ_CPMG: + raise RelaxError("The '%s' CPMG model is not compatible with the '%s' experiment type." % (self.model, self.exp_types[0])) + if self.model != MODEL_NOREX and self.model in MODEL_LIST_MQ_R1RHO and self.exp_types[0] != EXP_TYPE_MQ_R1RHO: + raise RelaxError("The '%s' R1rho model is not compatible with the '%s' experiment type." % (self.model, self.exp_types[0])) def func_CR72(self, params):