Module parameters
source code
Functions relating to the parameters of the relaxation dispersion
models.
numpy float array
|
|
|
copy(pipe_from=None,
pipe_to=None)
Copy dispersion parameters from one data pipe to another. |
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
|
|
|
param_conversion(key=None,
spins=None,
sim_index=None)
Calculate the non-model parameter values from the current parameter
values. |
source code
|
|
str, int, int
|
|
int
|
|
|
r1_setup()
Modify the current spin parameter list to either include or exclude
the R1 parameter. |
source code
|
|
|
set_value(value=None,
key=None,
spins=None,
sim_index=None,
param_name=None,
spin_index=None,
r20_key=None)
Set a specific parameter value. |
source code
|
|
|
__package__ = ' specific_analyses.relax_disp '
|
Imports:
deepcopy,
array,
float64,
median,
zeros,
sys,
MODEL_LIST_MMQ,
MODEL_M61B,
MODEL_NS_MMQ_3SITE,
MODEL_NS_MMQ_3SITE_LINEAR,
MODEL_NS_R1RHO_3SITE,
MODEL_NS_R1RHO_3SITE_LINEAR,
PARAMS_R1,
PARAMS_R20,
PARAMS_CHEM_SHIFT_DIFF,
PARAMS_CHEM_SHIFT_DIFF_MMQ,
PARAMS_SPIN,
RelaxError,
RelaxNoSequenceError,
subsection,
pipes,
exists_mol_res_spin_data,
return_spin,
spin_loop,
check_pipe,
count_spins,
generate_r20_key,
has_exponential_exp_type,
is_r1_optimised,
loop_cluster,
loop_exp_frq
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.
|
Copy dispersion parameters from one data pipe to another.
For spin clusters, the median of previous values is taken to avoid
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 relaxation dispersion 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.
full (bool) - A flag which if True will add the R2 key to the parameter names.
|
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 <= R1 <= 200
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 <= kB <= 2e6
0 <= kC <= 2e6
0 <= k_AB <= 100
tex >= 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 | | R1 | | 0 |
| | | | | |
|-1 0 0 | | R1 | | -200 |
| | | | | |
| 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 | | k_AB | | 0 |
| | | | | |
|-1 0 0 | | k_AB | | 100 |
| | | | | |
| 1 0 0 | | tex | | 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 model 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
|
Calculate the non-model parameter values from the current parameter
values.
- 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
|
Set a specific parameter value.
- 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.
|