Package user_functions :: Module relax_fit
[hide private]
[frames] | no frames]

Source Code for Module user_functions.relax_fit

  1  ############################################################################### 
  2  #                                                                             # 
  3  # Copyright (C) 2004-2012 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 relax_fit user function definitions.""" 
 24   
 25  # relax module imports. 
 26  from generic_fns import spectrum 
 27  from graphics import WIZARD_IMAGE_PATH 
 28  from specific_fns.setup import relax_fit_obj 
 29  from user_functions.data import Uf_info; uf_info = Uf_info() 
 30  from user_functions.objects import Desc_container 
 31   
 32   
 33  # The user function class. 
 34  uf_class = uf_info.add_class('relax_fit') 
 35  uf_class.title = "Class for relaxation curve fitting." 
 36  uf_class.menu_text = "&relax_fit" 
 37  uf_class.gui_icon = "relax.relax_fit" 
 38   
 39   
 40  # The relax_fit.relax_time user function. 
 41  uf = uf_info.add_uf('relax_fit.relax_time') 
 42  uf.title = "Set the relaxation delay time associated with each spectrum." 
 43  uf.title_short = "Relaxation delay time setting." 
 44  uf.add_keyarg( 
 45      name = "time", 
 46      default = 0.0, 
 47      py_type = "num", 
 48      desc_short = "relaxation time", 
 49      desc = "The time, in seconds, of the relaxation period." 
 50  ) 
 51  uf.add_keyarg( 
 52      name = "spectrum_id", 
 53      py_type = "str", 
 54      desc_short = "spectrum identification string", 
 55      desc = "The spectrum identification string.", 
 56      wiz_element_type = 'combo', 
 57      wiz_combo_iter = spectrum.get_ids, 
 58      wiz_read_only = True 
 59  ) 
 60  # Description. 
 61  uf.desc.append(Desc_container()) 
 62  uf.desc[-1].add_paragraph("Peak intensities should be loaded before calling this user function via the spectrum.read_intensities user function.  The intensity values will then be associated with a spectrum identifier.  To associate each spectrum identifier with a time point in the relaxation curve prior to optimisation, this user function should be called.") 
 63  uf.backend = relax_fit_obj._relax_time 
 64  uf.menu_text = "&relax_time" 
 65  uf.gui_icon = "oxygen.actions.chronometer" 
 66  uf.wizard_size = (700, 500) 
 67   
 68   
 69  # The relax_fit.select_model user function. 
 70  uf = uf_info.add_uf('relax_fit.select_model') 
 71  uf.title = "Select the relaxation curve type." 
 72  uf.title_short = "Relaxation curve type selection." 
 73  uf.display = True 
 74  uf.add_keyarg( 
 75      name = "model", 
 76      default = "exp", 
 77      py_type = "str", 
 78      desc_short = "model", 
 79      desc = "The type of relaxation curve to fit.", 
 80      wiz_element_type = "combo", 
 81      wiz_combo_choices = [ 
 82          "exp: [Rx, I0]", 
 83          "inv: [Rx, I0, Iinf]" 
 84      ], 
 85      wiz_combo_data = [ 
 86          "exp", 
 87          "inv" 
 88      ], 
 89      wiz_read_only = True 
 90  ) 
 91  # Description. 
 92  uf.desc.append(Desc_container()) 
 93  uf.desc[-1].add_paragraph("The supported relaxation experiments include the default two parameter exponential fit, selected by setting the model type to 'exp', and the three parameter inversion recovery experiment in which the peak intensity limit is a non-zero value, selected by setting the model to 'inv'.") 
 94  uf.desc[-1].add_paragraph("The parameters of these two models are") 
 95  uf.desc[-1].add_item_list_element("'exp'", "[Rx, I0],") 
 96  uf.desc[-1].add_item_list_element("'inv'", "[Rx, I0, Iinf].") 
 97  uf.backend = relax_fit_obj._select_model 
 98  uf.menu_text = "&select_model" 
 99  uf.gui_icon = "oxygen.actions.list-add" 
100  uf.wizard_height_desc = 300 
101  uf.wizard_size = (800, 500) 
102  uf.wizard_apply_button = False 
103