Package specific_fns :: Module relax_fit :: Class Relax_fit
[hide private]
[frames] | no frames]

Class Relax_fit

source code


Instance Methods [hide private]
 
__init__(self, relax)
Class containing functions for relaxation data.
source code
 
assemble_param_vector(self, index=None, sim_index=None)
Function for assembling various pieces of data into a Numeric parameter array.
source code
 
assemble_scaling_matrix(self, index=None, scaling=1)
Function for creating the scaling matrix.
source code
 
assign_function(self, run=None, i=None, intensity=None)
Function for assigning peak intensity data to either the reference or saturated spectra.
source code
 
back_calc(self, run=None, index=None, relax_time_index=None)
Back-calculation of peak intensity for the given relaxation time.
source code
 
create_mc_data(self, run, i)
Function for creating the Monte Carlo peak intensity data.
source code
 
data_init(self)
Function for initialising the data structures.
source code
 
data_names(self, set='all')
Function for returning a list of names of data structures.
source code
 
default_value(self, param)
Relaxation curve fitting default values ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
source code
 
disassemble_param_vector(self, index=None, sim_index=None)
Function for disassembling the parameter vector.
source code
 
grid_search(self, run, lower, upper, inc, constraints, print_flag, sim_index=None)
The grid search function.
source code
 
grid_search_setup(self, index=None)
The grid search setup function.
source code
 
linear_constraints(self, index=None)
Function for setting up the linear constraint matrices A and b.
source code
 
mean_and_error(self, run=None, print_flag=0)
Function for calculating the average intensity and standard deviation of all spectra.
source code
 
minimise(self, run=None, min_algor=None, min_options=None, func_tol=None, grad_tol=None, max_iterations=None, constraints=0, scaling=1, print_flag=0, sim_index=None)
Relaxation curve fitting function.
source code
 
model_setup(self, model, params)
Function for updating various data structures dependant on the model selected.
source code
 
num_instances(self, run=None)
Function for returning the number of instances.
source code
 
overfit_deselect(self, run)
Function for deselecting residues without sufficient data to support minimisation
source code
 
read(self, run=None, file=None, dir=None, relax_time=0.0, format=None, heteronuc=None, proton=None, int_col=None)
Function for reading peak intensity data.
source code
 
return_conversion_factor(self, stat_type)
Dummy function for returning 1.0.
source code
 
return_data(self, run, i)
Function for returning the peak intensity data structure.
source code
 
return_error(self, run, i)
Function for returning the standard deviation data structure.
source code
 
return_data_name(self, name)
Relaxation curve fitting data type string matching patterns ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
source code
 
return_grace_string(self, data_type)
Function for returning the Grace string representing the data type for axis labelling.
source code
 
return_units(self, stat_type)
Dummy function which returns None as the stats have no units.
source code
 
select_model(self, run=None, model='exp')
Function for selecting the model of the exponential curve.
source code
 
set_doc(self)
Relaxation curve fitting set details ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
source code
 
set_selected_sim(self, run, instance, select_sim)
Function for returning the array of selected simulation flags.
source code
 
sim_pack_data(self, run, i, sim_data)
Function for packing Monte Carlo simulation data.
source code

Inherited from base_class.Common_functions: has_errors, return_value, set, set_error, set_update, sim_init_values, sim_return_param, sim_return_selected

Method Details [hide private]

__init__(self, relax)
(Constructor)

source code 

Class containing functions for relaxation data.

Overrides: base_class.Common_functions.__init__

data_names(self, set='all')

source code 
Function for returning a list of names of data structures.

Description
~~~~~~~~~~~

The names are as follows:

params:  An array of the parameter names associated with the model.

rx:  Either the R1 or R2 relaxation rate.

i0:  The initial intensity.

iinf:  The intensity at infinity.

chi2:  Chi-squared value.

iter:  Iterations.

f_count:  Function count.

g_count:  Gradient count.

h_count:  Hessian count.

warning:  Minimisation warning.

default_value(self, param)

source code 

Relaxation curve fitting default values
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

These values are completely arbitrary as peak heights (or volumes) are extremely variable
and the Rx value is a compensation for both the R1 and R2 values.
___________________________________________________________________
|                        |               |                        |
| Data type              | Object name   | Value                  |
|________________________|_______________|________________________|
|                        |               |                        |
| Relaxation rate        | 'rx'          | 8.0                    |
|                        |               |                        |
| Initial intensity      | 'i0'          | 10000.0                |
|                        |               |                        |
| Intensity at infinity  | 'iinf'        | 0.0                    |
|                        |               |                        |
|________________________|_______________|________________________|

linear_constraints(self, index=None)

source code 
Function for setting up the linear constraint matrices A and b.

Standard notation
~~~~~~~~~~~~~~~~~

The relaxation rate constraints are:

    Rx >= 0

The intensity constraints are:

    I0 >= 0
    Iinf >= 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 |     |  Rx  |      |    0    |
    |         |     |      |      |         |
    | 1  0  0 |  .  |  I0  |  >=  |    0    |
    |         |     |      |      |         |
    | 1  0  0 |     | Iinf |      |    0    |

return_data(self, run, i)

source code 

Function for returning the peak intensity data structure.

Overrides: base_class.Common_functions.return_data

return_error(self, run, i)

source code 

Function for returning the standard deviation data structure.

Overrides: base_class.Common_functions.return_error

return_data_name(self, name)

source code 

Relaxation curve fitting data type string matching patterns
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

__________________________________________________________________________________________
|                                   |                      |                             |
| Data type                         | Object name          | Patterns                    |
|___________________________________|______________________|_____________________________|
|                                   |                      |                             |
| Relaxation rate                   | 'rx'                 | '^[Rr]x$'                   |
|                                   |                      |                             |
| Average peak intensities (series) | 'ave_intensities'    | '^[Aa]ve[ -_][Ii]nt$'       |
|                                   |                      |                             |
| Initial intensity                 | 'i0'                 | '^[Ii]0$'                   |
|                                   |                      |                             |
| Intensity at infinity             | 'iinf'               | '^[Ii]inf$'                 |
|                                   |                      |                             |
| Relaxation period times (series)  | 'relax_times'        | '^[Rr]elax[ -_][Tt]imes$'   |
|___________________________________|______________________|_____________________________|

set_doc(self)

source code 

Relaxation curve fitting set details
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Only three parameters can be set, the relaxation rate (Rx), the initial intensity (I0), and
the intensity at infinity (Iinf).  Setting the parameter Iinf has no effect if the chosen
model is that of the exponential curve which decays to zero.