Package specific_fns :: Package model_free
[hide private]
[frames] | no frames]

Source Code for Package specific_fns.model_free

  1  ############################################################################### 
  2  #                                                                             # 
  3  # Copyright (C) 2007-2012 Edward d'Auvergne                                   # 
  4  #                                                                             # 
  5  # This file is part of the program relax.                                     # 
  6  #                                                                             # 
  7  # relax 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 2 of the License, or           # 
 10  # (at your option) any later version.                                         # 
 11  #                                                                             # 
 12  # relax 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 relax; if not, write to the Free Software                        # 
 19  # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA   # 
 20  #                                                                             # 
 21  ############################################################################### 
 22   
 23  # Module docstring. 
 24  """The model-free specific code.""" 
 25   
 26   
 27  # The available modules. 
 28  __all__ = [ 'bmrb', 
 29              'macro_base', 
 30              'main', 
 31              'mf_minimise', 
 32              'molmol', 
 33              'multi_processor_commands', 
 34              'pymol', 
 35              'results' 
 36  ] 
 37   
 38  # relax module imports. 
 39  from bmrb import Bmrb 
 40  from generic_fns import diffusion_tensor 
 41  from main import Model_free_main 
 42  from mf_minimise import Mf_minimise 
 43  from molmol import Molmol 
 44  from physical_constants import N15_CSA, NH_BOND_LENGTH 
 45  from pymol import Pymol 
 46  from results import Results 
 47  from specific_fns.api_base import API_base 
 48  from specific_fns.api_common import API_common 
 49   
 50   
51 -class Model_free(Model_free_main, Mf_minimise, Results, Bmrb, API_base, API_common):
52 """Parent class containing all the model-free specific functions.""" 53
54 - def __init__(self):
55 """Initialise the class by placing API_common methods into the API.""" 56 57 # Place methods into the API. 58 self.base_data_loop = self._base_data_loop_spin 59 self.return_error = self._return_error_relax_data 60 self.return_conversion_factor = self._return_conversion_factor_spin 61 self.return_grace_string = self._return_grace_string_spin 62 self.return_units = self._return_units_spin 63 self.return_value = self._return_value_general 64 self.sim_pack_data = self._sim_pack_relax_data 65 self.test_grid_ops = self._test_grid_ops_general 66 67 # Initialise the macro classes. 68 self._molmol_macros = Molmol() 69 self._pymol_macros = Pymol() 70 71 # Alias the macro creation methods. 72 self.pymol_macro = self._pymol_macros.create_macro 73 self.molmol_macro = self._molmol_macros.create_macro 74 75 # Set up the spin parameters. 76 self.SPIN_PARAMS.add('tm', default=diffusion_tensor.default_value('tm'), conv_factor=1e-9, grace_string='\\xt\\f{}\\sm', units='ns') 77 self.SPIN_PARAMS.add('Diso', default=diffusion_tensor.default_value('Diso')) 78 self.SPIN_PARAMS.add('Dx', default=diffusion_tensor.default_value('Dx')) 79 self.SPIN_PARAMS.add('Dy', default=diffusion_tensor.default_value('Dy')) 80 self.SPIN_PARAMS.add('Dz', default=diffusion_tensor.default_value('Dz')) 81 self.SPIN_PARAMS.add('Dpar', default=diffusion_tensor.default_value('Dpar')) 82 self.SPIN_PARAMS.add('Dper', default=diffusion_tensor.default_value('Dper')) 83 self.SPIN_PARAMS.add('Da', default=diffusion_tensor.default_value('Da')) 84 self.SPIN_PARAMS.add('Dratio', default=diffusion_tensor.default_value('Dratio')) 85 self.SPIN_PARAMS.add('alpha', default=diffusion_tensor.default_value('alpha')) 86 self.SPIN_PARAMS.add('beta', default=diffusion_tensor.default_value('beta')) 87 self.SPIN_PARAMS.add('gamma', default=diffusion_tensor.default_value('gamma')) 88 self.SPIN_PARAMS.add('theta', default=diffusion_tensor.default_value('theta')) 89 self.SPIN_PARAMS.add('phi', default=diffusion_tensor.default_value('phi')) 90 self.SPIN_PARAMS.add('local_tm', default=10.0 * 1e-9, desc='The spin specific global correlation time (seconds)', grace_string='\\xt\\f{}\\sm', units='ns') 91 self.SPIN_PARAMS.add('s2', default=0.8, desc='S2, the model-free generalised order parameter (S2 = S2f.S2s)', grace_string='\\qS\\v{0.4}\\z{0.71}2\\Q') 92 self.SPIN_PARAMS.add('s2f', default=0.8, desc='S2f, the faster motion model-free generalised order parameter', grace_string='\\qS\\sf\\N\\h{-0.2}\\v{0.4}\\z{0.71}2\\Q') 93 self.SPIN_PARAMS.add('s2s', default=0.8, desc='S2s, the slower motion model-free generalised order parameter', grace_string='\\qS\\ss\\N\\h{-0.2}\\v{0.4}\\z{0.71}2\\Q') 94 self.SPIN_PARAMS.add('te', default=100.0 * 1e-12, desc='Single motion effective internal correlation time (seconds)', conv_factor=1e-12, grace_string='\\xt\\f{}\\se', units='ps') 95 self.SPIN_PARAMS.add('tf', default=10.0 * 1e-12, desc='Faster motion effective internal correlation time (seconds)', conv_factor=1e-12, grace_string='\\xt\\f{}\\sf', units='ps') 96 self.SPIN_PARAMS.add('ts', default=1000.0 * 1e-12, desc='Slower motion effective internal correlation time (seconds)', conv_factor=1e-12, grace_string='\\xt\\f{}\\ss', units='ps') 97 self.SPIN_PARAMS.add('rex', default=0.0, desc='Chemical exchange relaxation (sigma_ex = Rex / omega**2)', conv_factor=self._conv_factor_rex, units=self._units_rex, grace_string='\\qR\\sex\\Q') 98 self.SPIN_PARAMS.add('r', default=NH_BOND_LENGTH, units='Angstrom', desc='Bond length (meters)', conv_factor=1e-10, grace_string='Bond length') 99 self.SPIN_PARAMS.add('csa', default=N15_CSA, units='ppm', desc='Chemical shift anisotropy (unitless)', conv_factor=1e-6, grace_string='\\qCSA\\Q') 100 self.SPIN_PARAMS.add('heteronuc_type', default='15N', desc='The heteronucleus spin type') 101 self.SPIN_PARAMS.add('proton_type', default='1H', desc='The proton spin type') 102 self.SPIN_PARAMS.add('model', desc='The model') 103 self.SPIN_PARAMS.add('equation', desc='The model equation') 104 self.SPIN_PARAMS.add('params', desc='The model parameters') 105 self.SPIN_PARAMS.add('xh_vect', desc='XH bond vector')
106