Package specific_analyses :: Package relax_fit :: Module optimisation
[hide private]
[frames] | no frames]

Module optimisation

source code

The R1 and R2 exponential relaxation curve fitting optimisation functions.

Functions [hide private]
float
back_calc(spin=None, relax_time_id=None)
Back-calculation of peak intensity for the given relaxation time.
source code
float
func_wrapper(params)
Wrapper function for the C module, for converting numpy arrays.
source code
 
dfunc_wrapper(params)
Wrapper function for the C module, for converting numpy arrays.
source code
 
d2func_wrapper(params)
Wrapper function for the C module, for converting numpy arrays.
source code
(int, list of lists [int, float, float])
grid_search_setup(spin=None, param_vector=None, lower=None, upper=None, inc=None, scaling_matrix=None)
The grid search setup function.
source code
Variables [hide private]
  __package__ = 'specific_analyses.relax_fit'

Imports: average, search, C_module_exp_fn, RelaxError, RelaxLenError, assemble_param_vector, assemble_scaling_matrix, setup, func, back_calc_I


Function Details [hide private]

back_calc(spin=None, relax_time_id=None)

source code 

Back-calculation of peak intensity for the given relaxation time.

Parameters:
  • spin (SpinContainer instance) - The spin container.
  • relax_time_id (str) - The ID string for the desired relaxation time.
Returns: float
The peak intensity for the desired relaxation time.

func_wrapper(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_wrapper(params)

source code 

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

The currently does nothing.

d2func_wrapper(params)

source code 

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

The currently does nothing.

grid_search_setup(spin=None, param_vector=None, lower=None, upper=None, inc=None, scaling_matrix=None)

source code 

The grid search setup function.

Parameters:
  • spin (SpinContainer instance) - The spin data container.
  • param_vector (numpy array) - The parameter vector.
  • lower (array of numbers) - The lower bounds of the grid search which must be equal to the number of parameters in the model. This optional argument is only used when doing a grid search.
  • upper (array of numbers) - The upper bounds of the grid search which must be equal to the number of parameters in the model. This optional argument is only used when doing a grid search.
  • inc (array of int) - The increments for each dimension of the space for the grid search. The number of elements in the array must equal to the number of parameters in the model. This argument is only used when doing a grid search.
  • scaling_matrix (numpy diagonal matrix) - The scaling matrix.
Returns: (int, list of lists [int, float, float])
A tuple of the grid size and the minimisation options. For the minimisation options, the first dimension corresponds to the model parameter. The second dimension is a list of the number of increments, the lower bound, and upper bound.