Author: bugman
Date: Sat Nov 29 10:18:50 2014
New Revision: 26828
URL: http://svn.gna.org/viewcvs/relax?rev=26828&view=rev
Log:
The exponential model name is now being passed into the target function class.
The model as specified by the relax_fit.select_model user function is now
finally being sent into
the target function, in this case the Relax_fit_opt class in
target_functions.relax_fit_wrapper.
Modified:
trunk/specific_analyses/relax_fit/api.py
trunk/specific_analyses/relax_fit/optimisation.py
trunk/target_functions/relax_fit_wrapper.py
Modified: trunk/specific_analyses/relax_fit/api.py
URL:
http://svn.gna.org/viewcvs/relax/trunk/specific_analyses/relax_fit/api.py?rev=26828&r1=26827&r2=26828&view=diff
==============================================================================
--- trunk/specific_analyses/relax_fit/api.py (original)
+++ trunk/specific_analyses/relax_fit/api.py Sat Nov 29 10:18:50 2014
@@ -135,7 +135,7 @@
# Initialise data in C code.
scaling_list = [1.0, 1.0]
- model = Relax_fit_opt(num_params=len(param_vector), values=values,
errors=errors, relax_times=times, scaling_matrix=scaling_list)
+ model = Relax_fit_opt(model=spin.model, num_params=len(param_vector),
values=values, errors=errors, relax_times=times, scaling_matrix=scaling_list)
# Use the direct Jacobian from function.
jacobian_matrix_exp = transpose(asarray( model.jacobian(param_vector)
) )
@@ -364,7 +364,7 @@
scaling_list.append(scaling_matrix[model_index][i, i])
# Set up the target function.
- model = Relax_fit_opt(num_params=len(spin.params), values=values,
errors=errors, relax_times=times, scaling_matrix=scaling_list)
+ model = Relax_fit_opt(model=spin.model,
num_params=len(spin.params), values=values, errors=errors, relax_times=times,
scaling_matrix=scaling_list)
# Setup the minimisation algorithm when constraints are present.
Modified: trunk/specific_analyses/relax_fit/optimisation.py
URL:
http://svn.gna.org/viewcvs/relax/trunk/specific_analyses/relax_fit/optimisation.py?rev=26828&r1=26827&r2=26828&view=diff
==============================================================================
--- trunk/specific_analyses/relax_fit/optimisation.py (original)
+++ trunk/specific_analyses/relax_fit/optimisation.py Sat Nov 29 10:18:50 2014
@@ -60,7 +60,7 @@
scaling_list.append(1.0)
# Initialise the relaxation fit functions.
- model = Relax_fit_opt(num_params=len(spin.params), values=values,
errors=errors, relax_times=times, scaling_matrix=scaling_list)
+ model = Relax_fit_opt(model=spin.model, num_params=len(spin.params),
values=values, errors=errors, relax_times=times, scaling_matrix=scaling_list)
# Make a single function call. This will cause back calculation and the
data will be stored in the C module.
model.func(param_vector)
Modified: trunk/target_functions/relax_fit_wrapper.py
URL:
http://svn.gna.org/viewcvs/relax/trunk/target_functions/relax_fit_wrapper.py?rev=26828&r1=26827&r2=26828&view=diff
==============================================================================
--- trunk/target_functions/relax_fit_wrapper.py (original)
+++ trunk/target_functions/relax_fit_wrapper.py Sat Nov 29 10:18:50 2014
@@ -38,9 +38,11 @@
class Relax_fit_opt:
"""The exponential curve-fitting Python to C wrapper target function
class."""
- def __init__(self, num_params=None, values=None, errors=None,
relax_times=None, scaling_matrix=None):
+ def __init__(self, model=None, num_params=None, values=None, errors=None,
relax_times=None, scaling_matrix=None):
"""Set up the target function class and alias the target functions.
+ @keyword model: The exponential curve type. This can be
'exp' for the standard two parameter exponential curve, 'inv' for the inversion
recovery experiment, and 'sat' for the saturation recovery experiment.
+ @type model: str
@keyword num_params: The number of parameters in the model.
@type num_params: int
@keyword values: The peak intensities.
@@ -52,6 +54,9 @@
@keyword scaling_matrix: The scaling matrix in a diagonalised list
form.
@type scaling_matrix: list of float
"""
+
+ # Store the args.
+ self.model = model
# Initialise the C code.
setup(num_params=num_params, num_times=len(relax_times),
values=values, sd=errors, relax_times=relax_times,
scaling_matrix=scaling_matrix)
_______________________________________________
relax (http://www.nmr-relax.com)
This is the relax-commits mailing list
[email protected]
To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-commits