Module parameters
source code
Functions relating to the parameters of the relaxation dispersion
models.
numpy float array
|
|
numpy diagonal matrix
|
|
|
copy(pipe_from=None,
pipe_to=None)
Copy dispersion parameters from one data pipe to another, taking the
median of previous values to a start value for clusters. |
source code
|
|
|
|
|
|
float
|
get_value(key=None,
spins=None,
sim_index=None,
param_name=None,
spin_index=None,
r20_key=None)
Return the value for the given parameter. |
source code
|
|
numpy rank-2 NxM array, numpy rank-1 N array
|
linear_constraints(spins=None,
scaling_matrix=None)
Set up the relaxation dispersion curve fitting linear constraint
matrices A and b. |
source code
|
|
str, int, int, str
|
|
|
|
str, int, int
|
|
int
|
|
|
set_value(value=None,
key=None,
spins=None,
sim_index=None,
param_name=None,
spin_index=None,
r20_key=None)
Return the value for the given parameter. |
source code
|
|
|
__package__ = ' specific_analyses.relax_disp '
|
Imports:
deepcopy,
array,
float64,
identity,
median,
zeros,
sys,
RelaxError,
RelaxNoSequenceError,
subsection,
pipes,
exists_mol_res_spin_data,
return_spin,
count_spins,
generate_r20_key,
has_exponential_exp_type,
loop_cluster,
loop_exp_frq,
MODEL_LIST_MMQ,
MODEL_M61B,
MODEL_NS_MMQ_3SITE,
MODEL_NS_MMQ_3SITE_LINEAR,
MODEL_NS_R1RHO_3SITE,
MODEL_NS_R1RHO_3SITE_LINEAR,
PARAMS_R20
assemble_param_vector(spins=None,
key=None,
sim_index=None)
| source code
|
Assemble the dispersion relaxation dispersion curve fitting parameter
vector.
- Parameters:
spins (list of SpinContainer instances) - The list of spin data containers for the block.
key (str or None) - The key for the R2eff and I0 parameters.
sim_index (int) - The optional MC simulation index.
- Returns: numpy float array
- An array of the parameter values of the dispersion relaxation
model.
|
assemble_scaling_matrix(spins=None,
key=None,
scaling=True)
| source code
|
Create and return the scaling matrix.
- Parameters:
spins (list of SpinContainer instances) - The list of spin data containers for the block.
key (str or None) - The key for the R2eff and I0 parameters.
scaling (bool) - A flag which if False will cause the identity matrix to be
returned.
- Returns: numpy diagonal matrix
- The diagonal and square scaling matrix.
|
Copy dispersion parameters from one data pipe to another, taking the
median of previous values to a start value for clusters. Taking the
median prevent averaging extreme outliers.
- Parameters:
pipe_from (str) - The data pipe to copy the value from. This defaults to the
current data pipe.
pipe_to (str) - The data pipe to copy the value to. This defaults to the current
data pipe.
|
disassemble_param_vector(param_vector=None,
key=None,
spins=None,
sim_index=None)
| source code
|
Disassemble the parameter vector.
- Parameters:
param_vector (numpy array) - The parameter vector.
key (str or None) - The key for the R2eff and I0 parameters.
spins (list of SpinContainer instances) - The list of spin data containers for the block.
sim_index (int) - The optional MC simulation index.
|
Generate a list of dispersion parameter names for the given spins.
- Parameters:
spins (list of SpinContainer instances) - The list of spin data containers for the block.
|
get_value(key=None,
spins=None,
sim_index=None,
param_name=None,
spin_index=None,
r20_key=None)
| source code
|
Return the value for the given parameter.
- Parameters:
key (str or None) - The key for the R2eff and I0 parameters.
spins (list of SpinContainer instances) - The list of spin data containers for the block.
sim_index (int) - The optional MC simulation index.
param_name (str) - The parameter name.
spin_index (int) - The spin index (for the cluster).
r20_key (str) - The unique R20 parameter key.
- Returns: float
- The parameter value.
|
linear_constraints(spins=None,
scaling_matrix=None)
| source code
|
Set up the relaxation dispersion curve fitting linear constraint
matrices A and b.
Standard notation
The different constraints used within different models are:
0 <= R2 <= 200
0 <= R2A <= 200
0 <= R2B <= 200
pC <= pB <= pA <= 1
pA >= 0.85 (the skewed condition, pA >> pB)
pB >= 0
pC >= 0
phi_ex >= 0
phi_ex_B >= 0
phi_ex_C >= 0
padw2 >= 0
dw >= 0
0 <= kex <= 2e6
0 <= k_AB <= 2e6
0 <= kB <= 2e6
0 <= kC <= 2e6
tex >= 0
k_AB >= 0
Matrix notation
In the notation A.x >= b, where A is a matrix of coefficients, x
is an array of parameter values, and b is a vector of scalars, these
inequality constraints are:
| 1 0 0 | | R2 | | 0 |
| | | | | |
|-1 0 0 | | R2 | | -200 |
| | | | | |
| 1 0 0 | | R2A | | 0 |
| | | | | |
|-1 0 0 | | R2A | | -200 |
| | | | | |
| 1 0 0 | | R2B | | 0 |
| | | | | |
|-1 0 0 | | R2B | | -200 |
| | | | | |
| 1 0 0 | | pA | | 0.5 |
| | | | | |
|-1 0 0 | | pA | | -1 |
| | | | | |
| 1 0 0 | | pA | | 0.85 |
| | | | | |
| 1 0 0 | | pB | | 0 |
| | | | | |
| 1 0 0 | | phi_ex | | 0 |
| | | | | |
| 1 0 0 | . | phi_ex_B | >= | 0 |
| | | | | |
| 1 0 0 | | phi_ex_C | | 0 |
| | | | | |
| 1 0 0 | | padw2 | | 0 |
| | | | | |
| 1 0 0 | | dw | | 0 |
| | | | | |
| 1 0 0 | | kex | | 0 |
| | | | | |
|-1 0 0 | | kex | | -2e6 |
| | | | | |
| 1 0 0 | | kB | | 0 |
| | | | | |
|-1 0 0 | | kB | | -2e6 |
| | | | | |
| 1 0 0 | | kC | | 0 |
| | | | | |
|-1 0 0 | | kC | | -2e6 |
| | | | | |
| 1 0 0 | | tex | | 0 |
| | | | | |
| 1 0 0 | | k_AB | | 0 |
- Parameters:
spins (list of SpinContainer instances) - The list of spin data containers for the block.
scaling_matrix (numpy diagonal matrix) - The diagonal, square scaling matrix.
- Returns: numpy rank-2 NxM array, numpy rank-1 N array
- The matrices A and b.
|
Generator function for looping of the parameters of the cluster.
- Parameters:
spins (list of SpinContainer instances) - The list of spin data containers for the block.
- Returns: str, int, int, str
- The parameter name, the parameter index (for the parameter
vector), the spin index (for the cluster), and the R20 parameter
key (for R20, R20A, and R20B parameters stored as dictionaries).
|
param_conversion(key=None,
spins=None,
sim_index=None)
| source code
|
Convert Disassemble the parameter vector.
- Parameters:
key (str or None) - The key for the R2eff and I0 parameters.
spins (list of SpinContainer instances) - The list of spin data containers for the block.
sim_index (int) - The optional MC simulation index.
|
param_index_to_param_info(index=None,
spins=None)
| source code
|
Convert the given parameter array index to parameter identifying
information.
The parameter index will be converted to the parameter name, the
relevant spin index in the cluster, and relevant exponential curve
key.
- Parameters:
index (int) - The index of the parameter array.
spins (list of SpinContainer instances) - The list of spin data containers for the block.
- Returns: str, int, int
- The parameter name, the spin index (for the cluster), and the
frequency index (for parameters with different values per
spectrometer field strength).
|
Determine the number of parameters in the model.
- Parameters:
spins (list of SpinContainer instances) - The list of spin data containers for the block.
- Returns: int
- The number of model parameters.
|
set_value(value=None,
key=None,
spins=None,
sim_index=None,
param_name=None,
spin_index=None,
r20_key=None)
| source code
|
Return the value for the given parameter.
- Parameters:
value (float) - The parameter value to set.
key (str or None) - The key for the R2eff and I0 parameters.
spins (list of SpinContainer instances) - The list of spin data containers for the block.
sim_index (int) - The optional MC simulation index.
param_name (str) - The parameter name.
spin_index (int) - The spin index (for the cluster).
r20_key (str) - The unique R20 parameter key.
|