Author: bugman Date: Wed Mar 27 18:14:20 2013 New Revision: 19269 URL: http://svn.gna.org/viewcvs/relax?rev=19269&view=rev Log: Added the model argument to the dispersion target function class to select between different equations. Modified: branches/relax_disp/specific_analyses/relax_disp.py branches/relax_disp/target_functions/relax_disp.py Modified: branches/relax_disp/specific_analyses/relax_disp.py URL: http://svn.gna.org/viewcvs/relax/branches/relax_disp/specific_analyses/relax_disp.py?rev=19269&r1=19268&r2=19269&view=diff ============================================================================== --- branches/relax_disp/specific_analyses/relax_disp.py (original) +++ branches/relax_disp/specific_analyses/relax_disp.py Wed Mar 27 18:14:20 2013 @@ -960,7 +960,7 @@ else: values = spin.sim_intensities[sim_index] - model = Dispersion(num_params=len(spin.params), num_times=len(cdp.cpmg_frqs), values=values, sd=spin.intensity_err, cpmg_frqs=cdp.cpmg_frqs, scaling_matrix=scaling_matrix) + model = Dispersion(model=cdp.curve_type, num_params=len(spin.params), num_times=len(cdp.cpmg_frqs), values=values, sd=spin.intensity_err, cpmg_frqs=cdp.cpmg_frqs, scaling_matrix=scaling_matrix) # Setup the minimisation algorithm when constraints are present. 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=19269&r1=19268&r2=19269&view=diff ============================================================================== --- branches/relax_disp/target_functions/relax_disp.py (original) +++ branches/relax_disp/target_functions/relax_disp.py Wed Mar 27 18:14:20 2013 @@ -28,9 +28,11 @@ class Dispersion: - def __init__(self, num_params=None, num_times=None, values=None, sd=None, cpmg_frqs=None, scaling_matrix=None): + def __init__(self, model=None, num_params=None, num_times=None, values=None, sd=None, cpmg_frqs=None, scaling_matrix=None): """Relaxation dispersion target functions for optimisation. + @keyword model: The relaxation dispersion model to fit. + @type model: str @keyword num_param: The number of parameters in the model. @type num_param: int @keyword num_times: The number of relaxation times. @@ -53,6 +55,10 @@ self.cpmg_frqs = cpmg_frqs self.scaling_matrix = scaling_matrix + # Set up the model. + if model == 'fast': + self.func = self.func_fast_2site + def func_fast_2site(self, params): """Target function for the fast 2-site exchange model.