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

Module optimisation

source code

Module for the optimisation of the relaxation dispersion models.

Classes [hide private]
  Disp_memo
The relaxation dispersion memo class.
  Disp_minimise_command
Command class for relaxation dispersion optimisation on the slave processor.
  Disp_result_command
Class for processing the dispersion optimisation results.
Functions [hide private]
numpy rank-1 float array
back_calc_peak_intensities(spin=None, exp_type=None, frq=None, offset=None, point=None)
Back-calculation of peak intensity for the given relaxation time.
source code
numpy rank-1 float array
back_calc_r2eff(spin=None, spin_id=None, cpmg_frqs=None, spin_lock_nu1=None, store_chi2=False)
Back-calculation of R2eff/R1rho values for the given spin.
source code
 
calculate_r2eff()
Calculate the R2eff values for fixed relaxation time period data.
source code
(int, list of lists [int, float, float])
grid_search_setup(spins=None, spin_ids=None, param_vector=None, lower=None, upper=None, inc=None, scaling_matrix=None)
The grid search setup function.
source code
 
minimise_r2eff(min_algor=None, min_options=None, func_tol=None, grad_tol=None, max_iterations=None, constraints=False, scaling=True, verbosity=0, sim_index=None, lower=None, upper=None, inc=None)
Optimise the R2eff model by fitting the 2-parameter exponential curves.
source code
Variables [hide private]
  __package__ = 'specific_analyses.relax_disp'

Imports: generic_minimise, grid, dot, float64, int32, ones, zeros, inv, match, search, sys, C_module_exp_fn, is_float, calc_two_point_r2eff, calc_two_point_r2eff_err, RelaxError, subsection, Memo, Result_command, Slave_command, spin_loop, check_disp_points, check_exp_type, check_exp_type_fixed_time, average_intensity, count_spins, find_intensity_keys, has_exponential_exp_type, has_proton_mmq_cpmg, loop_exp, loop_exp_frq_offset_point, loop_exp_frq_offset_point_time, loop_frq, loop_offset, loop_time, pack_back_calc_r2eff, return_cpmg_frqs, return_offset_data, return_param_key_from_data, return_r1_data, return_r2eff_arrays, return_spin_lock_nu1, assemble_param_vector, assemble_scaling_matrix, disassemble_param_vector, linear_constraints, loop_parameters, param_conversion, param_num, EXP_TYPE_LIST_CPMG, MODEL_CR72, MODEL_CR72_FULL, MODEL_LIST_MMQ, MODEL_LM63, MODEL_M61, MODEL_M61B, MODEL_MP05, MODEL_TAP03, MODEL_TP02, Dispersion, setup, func, dfunc, d2func, back_calc_I


Function Details [hide private]

back_calc_peak_intensities(spin=None, exp_type=None, frq=None, offset=None, point=None)

source code 

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

Parameters:
  • spin (SpinContainer instance) - The specific spin data container.
  • exp_type (str) - The experiment type.
  • frq (float) - The spectrometer frequency.
  • offset (None or float) - For R1rho-type data, the spin-lock offset value in ppm.
  • point (float) - The dispersion point data (either the spin-lock field strength in Hz or the nu_CPMG frequency in Hz).
Returns: numpy rank-1 float array
The back-calculated peak intensities for the given exponential curve.

back_calc_r2eff(spin=None, spin_id=None, cpmg_frqs=None, spin_lock_nu1=None, store_chi2=False)

source code 

Back-calculation of R2eff/R1rho values for the given spin.

Parameters:
  • spin (SpinContainer instance) - The specific spin data container.
  • spin_id (str) - The spin ID string for the spin container.
  • cpmg_frqs (list of lists of numpy rank-1 float arrays) - The CPMG frequencies to use instead of the user loaded values - to enable interpolation.
  • spin_lock_nu1 (list of lists of numpy rank-1 float arrays) - The spin-lock field strengths to use instead of the user loaded values - to enable interpolation.
  • store_chi2 (bool) - A flag which if True will cause the spin specific chi-squared value to be stored in the spin container.
Returns: numpy rank-1 float array
The back-calculated R2eff/R1rho value for the given spin.

grid_search_setup(spins=None, spin_ids=None, param_vector=None, lower=None, upper=None, inc=None, scaling_matrix=None)

source code 

The grid search setup function.

Parameters:
  • spins (list of SpinContainer instances) - The list of spin data containers for the block.
  • spin_ids (list of str) - The corresponding spin ID strings.
  • 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.

minimise_r2eff(min_algor=None, min_options=None, func_tol=None, grad_tol=None, max_iterations=None, constraints=False, scaling=True, verbosity=0, sim_index=None, lower=None, upper=None, inc=None)

source code 

Optimise the R2eff model by fitting the 2-parameter exponential curves.

This mimics the R1 and R2 relax_fit analysis.

Parameters:
  • min_algor (str) - The minimisation algorithm to use.
  • min_options (array of str) - An array of options to be used by the minimisation algorithm.
  • func_tol (None or float) - The function tolerance which, when reached, terminates optimisation. Setting this to None turns of the check.
  • grad_tol (None or float) - The gradient tolerance which, when reached, terminates optimisation. Setting this to None turns of the check.
  • max_iterations (int) - The maximum number of iterations for the algorithm.
  • constraints (bool) - If True, constraints are used during optimisation.
  • scaling (bool) - If True, diagonal scaling is enabled during optimisation to allow the problem to be better conditioned.
  • verbosity (int) - The amount of information to print. The higher the value, the greater the verbosity.
  • sim_index (None or int) - The index of the simulation to optimise. This should be None if normal optimisation is desired.
  • 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.