Package target_functions :: Module relax_fit_wrapper :: Class Relax_fit_opt
[hide private]
[frames] | no frames]

Class Relax_fit_opt

source code

The exponential curve-fitting Python to C wrapper target function class.

Instance Methods [hide private]
 
__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.
source code
list of float
back_calc_data(self)
Return the back-calculated data from the C code.
source code
float
func_exp(self, params)
Wrapper function for the C module, for converting numpy arrays.
source code
float
func_inv(self, params)
Wrapper function for the C module, for converting numpy arrays.
source code
float
func_sat(self, params)
Wrapper function for the C module, for converting numpy arrays.
source code
numpy float64 array
dfunc_exp(self, params)
Wrapper function for the C module, for converting numpy arrays.
source code
numpy float64 array
dfunc_inv(self, params)
Wrapper function for the C module, for converting numpy arrays.
source code
numpy float64 array
dfunc_sat(self, params)
Wrapper function for the C module, for converting numpy arrays.
source code
numpy float64 rank-2 array
d2func_exp(self, params)
Wrapper function for the C module, for converting numpy arrays.
source code
numpy float64 rank-2 array
d2func_inv(self, params)
Wrapper function for the C module, for converting numpy arrays.
source code
numpy float64 rank-2 array
d2func_sat(self, params)
Wrapper function for the C module, for converting numpy arrays.
source code
Method Details [hide private]

__init__(self, model=None, num_params=None, values=None, errors=None, relax_times=None, scaling_matrix=None)
(Constructor)

source code 

Set up the target function class and alias the target functions.

Parameters:
  • model (str) - 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.
  • num_params (int) - The number of parameters in the model.
  • values (list of float) - The peak intensities.
  • errors (list of float) - The peak intensity errors.
  • relax_times (list of float) - The list of relaxation times.
  • scaling_matrix (list of float) - The scaling matrix in a diagonalised list form.

back_calc_data(self)

source code 

Return the back-calculated data from the C code.

Returns: list of float
The back-calculated peak intensities.

func_exp(self, params)

source code 

Wrapper function for the C module, for converting numpy arrays.

Parameters:
  • params (numpy array) - The parameter array from the minimisation code.
Returns: float
The function value generated by the C module.

func_inv(self, params)

source code 

Wrapper function for the C module, for converting numpy arrays.

Parameters:
  • params (numpy array) - The parameter array from the minimisation code.
Returns: float
The function value generated by the C module.

func_sat(self, params)

source code 

Wrapper function for the C module, for converting numpy arrays.

Parameters:
  • params (numpy array) - The parameter array from the minimisation code.
Returns: float
The function value generated by the C module.

dfunc_exp(self, params)

source code 

Wrapper function for the C module, for converting numpy arrays.

Parameters:
  • params (numpy array) - The parameter array from the minimisation code.
Returns: numpy float64 array
The gradient generated by the C module converted to numpy format.

dfunc_inv(self, params)

source code 

Wrapper function for the C module, for converting numpy arrays.

Parameters:
  • params (numpy array) - The parameter array from the minimisation code.
Returns: numpy float64 array
The gradient generated by the C module converted to numpy format.

dfunc_sat(self, params)

source code 

Wrapper function for the C module, for converting numpy arrays.

Parameters:
  • params (numpy array) - The parameter array from the minimisation code.
Returns: numpy float64 array
The gradient generated by the C module converted to numpy format.

d2func_exp(self, params)

source code 

Wrapper function for the C module, for converting numpy arrays.

Parameters:
  • params (numpy array) - The parameter array from the minimisation code.
Returns: numpy float64 rank-2 array
The Hessian generated by the C module converted to numpy format.

d2func_inv(self, params)

source code 

Wrapper function for the C module, for converting numpy arrays.

Parameters:
  • params (numpy array) - The parameter array from the minimisation code.
Returns: numpy float64 rank-2 array
The Hessian generated by the C module converted to numpy format.

d2func_sat(self, params)

source code 

Wrapper function for the C module, for converting numpy arrays.

Parameters:
  • params (numpy array) - The parameter array from the minimisation code.
Returns: numpy float64 rank-2 array
The Hessian generated by the C module converted to numpy format.