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

Source Code for Module user_functions.spectrometer

  1  ############################################################################### 
  2  #                                                                             # 
  3  # Copyright (C) 2008-2013 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 spectrometer user function definitions for loading spectrometer information.""" 
 24   
 25  # relax module imports. 
 26  from graphics import WIZARD_IMAGE_PATH 
 27  from pipe_control import spectrum 
 28  import pipe_control.spectrometer 
 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('spectrometer') 
 35  uf_class.title = "Class for manipulating spectrometer frequencies." 
 36  uf_class.menu_text = "&spectrometer" 
 37  uf_class.gui_icon = "relax.spectrometer" 
 38   
 39  # The spectrometer.frequency user function. 
 40  uf = uf_info.add_uf('spectrometer.frequency') 
 41  uf.title = "Set the spectrometer proton frequency of the experiment." 
 42  uf.title_short = "Spectrometer frequency setup." 
 43  uf.add_keyarg( 
 44      name = "id", 
 45      py_type = "str", 
 46      desc_short = "experiment ID", 
 47      desc = "The experiment identification string to set the frequency of.", 
 48      wiz_element_type = 'combo', 
 49      wiz_combo_iter = spectrum.get_ids 
 50  ) 
 51  uf.add_keyarg( 
 52      name = "frq", 
 53      py_type = "num", 
 54      desc_short = "spectrometer frequency", 
 55      desc = "The spectrometer frequency.  See the 'sfrq' parameter in the Varian procpar file or the 'SFO1' parameter in the Bruker acqus file." 
 56  ) 
 57  uf.add_keyarg( 
 58      name = "units", 
 59      default = "Hz", 
 60      py_type = "str", 
 61      desc_short = "frequency units", 
 62      desc = "The units of frequency.", 
 63      wiz_element_type = "combo", 
 64      wiz_combo_choices = [ 
 65          "Hz", 
 66          "kHz", 
 67          "MHz", 
 68          "GHz" 
 69      ], 
 70      wiz_read_only = False 
 71  ) 
 72  # Description. 
 73  uf.desc.append(Desc_container()) 
 74  uf.desc[-1].add_paragraph("This allows the spectrometer frequency of a given experiment to be set.  The expected units are that of the proton resonance frequency in Hertz.  See the 'sfrq' parameter in the Varian procpar file or the 'SFO1' parameter in the Bruker acqus file for the exact value.") 
 75  uf.backend = pipe_control.spectrometer.set_frequency 
 76  uf.menu_text = "&frequency" 
 77  uf.gui_icon = "relax.frq" 
 78  uf.wizard_size = (750, 500) 
 79  uf.wizard_image = WIZARD_IMAGE_PATH + 'spectrometer.png' 
 80   
 81   
 82  # The spectrometer.temperature user function. 
 83  uf = uf_info.add_uf('spectrometer.temperature') 
 84  uf.title = "Specify the temperature of an experiment." 
 85  uf.title_short = "Experimental temperature." 
 86  uf.add_keyarg( 
 87      name = "id", 
 88      py_type = "str", 
 89      desc_short = "experiment ID string", 
 90      desc = "The experiment identification string." 
 91  ) 
 92  uf.add_keyarg( 
 93      name = "temp", 
 94      py_type = "num", 
 95      desc_short = "experimental temperature", 
 96      desc = "The temperature of the experiment in Kalvin." 
 97  ) 
 98  # Description. 
 99  uf.desc.append(Desc_container()) 
100  uf.desc[-1].add_paragraph("This allows the temperature of an experiment to be set.  This value should be in Kalvin.  In certain analyses, for example those which use pseudocontact shift data, knowledge of the temperature is essential.  For the pseudocontact shift, the experiment ID string should match one of the alignment IDs.") 
101  uf.backend = pipe_control.spectrometer.set_temperature 
102  uf.menu_text = "&temperature" 
103  uf.gui_icon = "oxygen.status.weather-clear" 
104  uf.wizard_size = (700, 500) 
105  uf.wizard_image = WIZARD_IMAGE_PATH + 'oxygen-icon-weather-snow-scattered-night.png' 
106