Package specific_analyses :: Package model_free :: Module parameters
[hide private]
[frames] | no frames]

Module parameters

source code

The model-free analysis parameter functions.

Functions [hide private]
str or None
are_mf_params_set(spin)
Test if the model-free parameter values are set.
source code
list of str
assemble_param_names(model_type, spin_id=None)
Function for assembling a list of all the model parameter names.
source code
numpy array
assemble_param_vector(spin=None, spin_id=None, sim_index=None, model_type=None)
Assemble the model-free parameter vector (as numpy array).
source code
float
conv_factor_rex()
Calculate and return the Rex conversion factor.
source code
 
disassemble_param_vector(model_type, param_vector=None, spin=None, spin_id=None, sim_index=None)
Disassemble the model-free parameter vector.
source code
 
linear_constraints(num_params, model_type=None, spin=None, spin_id=None, scaling_matrix=None)
Set up the model-free linear constraint matrices A and b.
source code
str
units_rex()
Return the units for the Rex parameter.
source code
Variables [hide private]
  __package__ = 'specific_analyses.model_free'

Imports: pi, array, float64, int8, zeros, match, RelaxError, diffusion_tensor, spin_loop, determine_model_type


Function Details [hide private]

are_mf_params_set(spin)

source code 

Test if the model-free parameter values are set.

Parameters:
  • spin (SpinContainer instance) - The spin container object.
Returns: str or None
The name of the first parameter in the parameter list in which the corresponding parameter value is None. If all parameters are set, then None is returned.

assemble_param_names(model_type, spin_id=None)

source code 

Function for assembling a list of all the model parameter names.

Parameters:
  • model_type (str) - The model-free model type. This must be one of 'mf', 'local_tm', 'diff', or 'all'.
  • spin_id (str) - The spin identification string.
Returns: list of str
A list containing all the parameters of the model-free model.

assemble_param_vector(spin=None, spin_id=None, sim_index=None, model_type=None)

source code 

Assemble the model-free parameter vector (as numpy array).

If the spin argument is supplied, then the spin_id argument will be ignored.

Parameters:
  • spin (SpinContainer instance) - The spin data container.
  • spin_id (str) - The spin identification string.
  • sim_index (int) - The optional MC simulation index.
  • model_type (str or None) - The optional model type, one of 'all', 'diff', 'mf', or 'local_tm'.
Returns: numpy array
An array of the parameter values of the model-free model.

conv_factor_rex()

source code 

Calculate and return the Rex conversion factor.

Returns: float
The Rex conversion factor.

disassemble_param_vector(model_type, param_vector=None, spin=None, spin_id=None, sim_index=None)

source code 

Disassemble the model-free parameter vector.

Parameters:
  • model_type (str) - The model-free model type. This must be one of 'mf', 'local_tm', 'diff', or 'all'.
  • param_vector (numpy array) - The model-free parameter vector.
  • spin (SpinContainer instance) - The spin data container. If this argument is supplied, then the spin_id argument will be ignored.
  • spin_id (str) - The spin identification string.
  • sim_index (int) - The optional MC simulation index.

linear_constraints(num_params, model_type=None, spin=None, spin_id=None, scaling_matrix=None)

source code 

Set up the model-free linear constraint matrices A and b.

Standard notation

The order parameter constraints are:

   0 <= S2 <= 1
   0 <= S2f <= 1
   0 <= S2s <= 1

By substituting the formula S2 = S2f.S2s into the above inequalities, the additional two inequalities can be derived:

   S2 <= S2f
   S2 <= S2s

Correlation time constraints are:

   te >= 0
   tf >= 0
   ts >= 0

   tf <= ts

   te, tf, ts <= 2 * tm

Additional constraints used include:

   Rex >= 0
   0.9e-10 <= r <= 2e-10
   -300e-6 <= CSA <= 0

Rearranged notation

The above inequality constraints can be rearranged into:

   S2 >= 0
   -S2 >= -1
   S2f >= 0
   -S2f >= -1
   S2s >= 0
   -S2s >= -1
   S2f - S2 >= 0
   S2s - S2 >= 0
   te >= 0
   tf >= 0
   ts >= 0
   ts - tf >= 0
   Rex >= 0
   r >= 0.9e-10
   -r >= -2e-10
   CSA >= -300e-6
   -CSA >= 0

Matrix notation

In the notation A.x >= b, where A is an matrix of coefficients, x is an array of parameter values, and b is a vector of scalars, these inequality constraints are:

   | 1  0  0  0  0  0  0  0  0 |                  |    0    |
   |                           |                  |         |
   |-1  0  0  0  0  0  0  0  0 |                  |   -1    |
   |                           |                  |         |
   | 0  1  0  0  0  0  0  0  0 |                  |    0    |
   |                           |                  |         |
   | 0 -1  0  0  0  0  0  0  0 |                  |   -1    |
   |                           |                  |         |
   | 0  0  1  0  0  0  0  0  0 |     | S2  |      |    0    |
   |                           |     |     |      |         |
   | 0  0 -1  0  0  0  0  0  0 |     | S2f |      |   -1    |
   |                           |     |     |      |         |
   |-1  1  0  0  0  0  0  0  0 |     | S2s |      |    0    |
   |                           |     |     |      |         |
   |-1  0  1  0  0  0  0  0  0 |     | te  |      |    0    |
   |                           |     |     |      |         |
   | 0  0  0  1  0  0  0  0  0 |  .  | tf  |  >=  |    0    |
   |                           |     |     |      |         |
   | 0  0  0  0  1  0  0  0  0 |     | ts  |      |    0    |
   |                           |     |     |      |         |
   | 0  0  0  0  0  1  0  0  0 |     | Rex |      |    0    |
   |                           |     |     |      |         |
   | 0  0  0  0 -1  1  0  0  0 |     |  r  |      |    0    |
   |                           |     |     |      |         |
   | 0  0  0  0  0  0  1  0  0 |     | CSA |      |    0    |
   |                           |                  |         |
   | 0  0  0  0  0  0  0  1  0 |                  | 0.9e-10 |
   |                           |                  |         |
   | 0  0  0  0  0  0  0 -1  0 |                  | -2e-10  |
   |                           |                  |         |
   | 0  0  0  0  0  0  0  0  1 |                  | -300e-6 |
   |                           |                  |         |
   | 0  0  0  0  0  0  0  0 -1 |                  |    0    |
Parameters:
  • num_params (int) - The number of parameters in the model.
  • model_type (str) - The model type, one of 'all', 'diff', 'mf', or 'local_tm'.
  • spin (SpinContainer instance) - The spin data container. If this argument is supplied, then the spin_id argument will be ignored.
  • spin_id (str) - The spin identification string.
  • scaling_matrix (numpy diagonal matrix) - The diagonal, square scaling matrix.

units_rex()

source code 

Return the units for the Rex parameter.

Returns: str
The field strength dependent Rex units.