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

Source Code for Module specific_analyses.model_free.parameter_object

 1  ############################################################################### 
 2  #                                                                             # 
 3  # Copyright (C) 2007-2014 Edward d'Auvergne                                   # 
 4  #                                                                             # 
 5  # This file is part of the program relax (http://www.nmr-relax.com).          # 
 6  #                                                                             # 
 7  # This program is free software: you can redistribute it and/or modify        # 
 8  # it under the terms of the GNU General Public License as published by        # 
 9  # the Free Software Foundation, either version 3 of the License, or           # 
10  # (at your option) any later version.                                         # 
11  #                                                                             # 
12  # This program is distributed in the hope that it will be useful,             # 
13  # but WITHOUT ANY WARRANTY; without even the implied warranty of              # 
14  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               # 
15  # GNU General Public License for more details.                                # 
16  #                                                                             # 
17  # You should have received a copy of the GNU General Public License           # 
18  # along with this program.  If not, see <http://www.gnu.org/licenses/>.       # 
19  #                                                                             # 
20  ############################################################################### 
21   
22  # Module docstring. 
23  """The module for the Lipari-Szabo model-free parameter list object.""" 
24   
25  # relax module imports. 
26  from lib.physical_constants import N15_CSA 
27  from pipe_control import relax_data 
28  from specific_analyses.parameter_object import Param_list 
29  from specific_analyses.model_free.parameters import conv_factor_rex, units_rex 
30   
31   
32 -class Model_free_params(Param_list):
33 """The Lipari-Szabo model-free parameter list singleton.""" 34 35 # Class variable for storing the class instance (for the singleton design pattern). 36 _instance = None 37
38 - def __init__(self):
39 """Define all the parameters of the analysis.""" 40 41 # The object is already initialised. 42 if self._initialised: return 43 44 # Execute the base class __init__ method. 45 Param_list.__init__(self) 46 47 # Add the base data for the models. 48 self._add('ri_data', scope='spin', desc=relax_data.return_data_desc('ri_data'), py_type=dict, err=False, sim=True) 49 self._add('ri_data_err', scope='spin', desc=relax_data.return_data_desc('ri_data_err'), py_type=dict, err=False, sim=False) 50 51 # Add the model variables. 52 self._add_model_info(equation_flag=True) 53 54 # Add up the global model parameters. 55 self._add_diffusion_params() 56 57 # Add up the spin model parameters. 58 self._add('s2', scope='spin', default=0.8, desc='S2, the model-free generalised order parameter (S2 = S2f.S2s)', py_type=float, set='params', grace_string='\\qS\\v{0.4}\\z{0.71}2\\Q', err=True, sim=True) 59 self._add('s2f', scope='spin', default=0.8, desc='S2f, the faster motion model-free generalised order parameter', py_type=float, set='params', grace_string='\\qS\\sf\\N\\h{-0.2}\\v{0.4}\\z{0.71}2\\Q', err=True, sim=True) 60 self._add('s2s', scope='spin', default=0.8, desc='S2s, the slower motion model-free generalised order parameter', py_type=float, set='params', grace_string='\\qS\\ss\\N\\h{-0.2}\\v{0.4}\\z{0.71}2\\Q', err=True, sim=True) 61 self._add('local_tm', scope='spin', default=10.0 * 1e-9, desc='The spin specific global correlation time (seconds)', py_type=float, set='params', grace_string='\\xt\\f{}\\sm', units='ns', err=True, sim=True) 62 self._add('te', scope='spin', default=100.0 * 1e-12, desc='Single motion effective internal correlation time (seconds)', py_type=float, set='params', conv_factor=1e-12, grace_string='\\xt\\f{}\\se', units='ps', err=True, sim=True) 63 self._add('tf', scope='spin', default=10.0 * 1e-12, desc='Faster motion effective internal correlation time (seconds)', py_type=float, set='params', conv_factor=1e-12, grace_string='\\xt\\f{}\\sf', units='ps', err=True, sim=True) 64 self._add('ts', scope='spin', default=1000.0 * 1e-12, desc='Slower motion effective internal correlation time (seconds)', py_type=float, set='params', conv_factor=1e-12, grace_string='\\xt\\f{}\\ss', units='ps', err=True, sim=True) 65 self._add('rex', scope='spin', default=0.0, desc='Chemical exchange relaxation (sigma_ex = Rex / omega**2)', py_type=float, set='params', conv_factor=conv_factor_rex, units=units_rex, grace_string='\\qR\\sex\\Q', err=True, sim=True) 66 self._add_csa(default=N15_CSA, set='params', err=True, sim=True) 67 68 # Add the minimisation data. 69 self._add_min_data(min_stats_global=True, min_stats_spin=True) 70 71 # Set up the user function documentation. 72 self._set_uf_title("Model-free parameters") 73 self._uf_param_table(label="table: model-free parameters", caption="Model-free parameters.") 74 self._uf_param_table(label="table: model-free parameter writing", caption="Model-free parameters.") 75 self._uf_param_table(label="table: model-free parameters and min stats", caption="Model-free parameters and minimisation statistics.", sets=['params', 'fixed', 'min']) 76 self._uf_param_table(label="table: all model-free parameters", caption="Model-free parameters.", scope=None) 77 self._uf_param_table(label="table: model-free parameter value setting", caption="Model-free parameters.") 78 self._uf_param_table(label="table: model-free parameter value setting with defaults", caption="Model-free parameter value setting.", default=True) 79 80 # Parameter setting documentation. 81 for doc in self._uf_doc_loop(["table: model-free parameter value setting", "table: model-free parameter value setting with defaults"]): 82 doc.add_paragraph("Setting a parameter value may have no effect depending on which model-free model is chosen. For example if S2f values and S2s values are set but the data pipe corresponds to the model-free model 'm4' then because these data values are not parameters of the model they will have no effect.") 83 doc.add_paragraph("Note that the Rex values are scaled quadratically with field strength and should be supplied as a field strength independent value. Use the following formula to obtain the correct value:") 84 doc.add_verbatim(" value = rex / (2.0 * pi * frequency) ** 2") 85 doc.add_paragraph("where:") 86 doc.add_list_element("rex is the chemical exchange value for the current frequency.") 87 doc.add_list_element("frequency is the proton frequency corresponding to the data.") 88 89 # Parameter writing documentation. 90 for doc in self._uf_doc_loop(["table: model-free parameter writing"]): 91 doc.add_paragraph("For model-free theory it is assumed that Rex values are scaled quadratically with field strength. The values will be very small as they will be written out as a field strength independent value. Hence use the following formula to convert the value to that expected for a given magnetic field strength:") 92 doc.add_verbatim(" Rex = value * (2.0 * pi * frequency) ** 2") 93 doc.add_paragraph("The frequency is that of the proton in Hertz.")
94