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

Source Code for Module user_functions.bruker

 1  ############################################################################### 
 2  #                                                                             # 
 3  # Copyright (C) 2011-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 bruker user function definitions for interfacing with the Bruker Dynamics Center.""" 
24   
25  # Python module imports. 
26  import dep_check 
27  if dep_check.wx_module: 
28      from wx import FD_OPEN 
29  else: 
30      FD_OPEN = -1 
31   
32  # relax module imports. 
33  from graphics import WIZARD_IMAGE_PATH 
34  from pipe_control import bruker 
35  from user_functions.data import Uf_info; uf_info = Uf_info() 
36  from user_functions.objects import Desc_container 
37   
38   
39  # The user function class. 
40  uf_class = uf_info.add_class('bruker') 
41  uf_class.title = "Class containing the function for reading the Bruker Dynamics Center (DC) files." 
42  uf_class.menu_text = "&bruker" 
43  uf_class.gui_icon = "relax.bruker" 
44   
45   
46  # The bruker.read user function. 
47  uf = uf_info.add_uf('bruker.read') 
48  uf.title = "Read a Bruker Dynamics Center (DC) relaxation data file." 
49  uf.title_short = "Read a Bruker Dynamics Center file." 
50  uf.add_keyarg( 
51      name = "ri_id", 
52      py_type = "str", 
53      desc_short = "relaxation data ID string", 
54      desc = "The relaxation data ID string.  This must be a unique identifier." 
55  ) 
56  uf.add_keyarg( 
57      name = "file", 
58      py_type = "str", 
59      arg_type = "file sel", 
60      desc_short = "file name", 
61      desc = "The name of the Bruker Dynamics Center file containing the relaxation data.", 
62      wiz_filesel_style = FD_OPEN 
63  ) 
64  uf.add_keyarg( 
65      name = "dir", 
66      py_type = "str", 
67      arg_type = "dir", 
68      desc_short = "directory name", 
69      desc = "The directory where the file is located.", 
70      can_be_none = True 
71  ) 
72  # Description. 
73  uf.desc.append(Desc_container()) 
74  uf.desc[-1].add_paragraph("This user function is used to load all of the data out of a Bruker Dynamics Center (DC) relaxation data file for subsequent analysis within relax.  Currently the R1 and R2 relaxation rates and steady-state NOE data is supported.") 
75  uf.backend = bruker.read 
76  uf.menu_text = "&read" 
77  uf.gui_icon = "oxygen.actions.document-open" 
78  uf.wizard_size = (800, 500) 
79  uf.wizard_image = WIZARD_IMAGE_PATH + 'bruker.png' 
80