Package specific_analyses :: Package noe :: Module uf
[hide private]
[frames] | no frames]

Source Code for Module specific_analyses.noe.uf

 1  ############################################################################### 
 2  #                                                                             # 
 3  # Copyright (C) 2003-2005,2007-2010,2012-2014 Edward d'Auvergne               # 
 4  # Copyright (C) 2006 Chris MacRaild                                           # 
 5  # Copyright (C) 2008 Sebastien Morin                                          # 
 6  #                                                                             # 
 7  # This file is part of the program relax (http://www.nmr-relax.com).          # 
 8  #                                                                             # 
 9  # This program is free software: you can redistribute it and/or modify        # 
10  # it under the terms of the GNU General Public License as published by        # 
11  # the Free Software Foundation, either version 3 of the License, or           # 
12  # (at your option) any later version.                                         # 
13  #                                                                             # 
14  # This program is distributed in the hope that it will be useful,             # 
15  # but WITHOUT ANY WARRANTY; without even the implied warranty of              # 
16  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               # 
17  # GNU General Public License for more details.                                # 
18  #                                                                             # 
19  # You should have received a copy of the GNU General Public License           # 
20  # along with this program.  If not, see <http://www.gnu.org/licenses/>.       # 
21  #                                                                             # 
22  ############################################################################### 
23   
24  # Module docstring. 
25  """Module for all of the steady-state heteronuclear NOE specific user functions.""" 
26   
27  # relax module imports. 
28  from lib.errors import RelaxError 
29  from pipe_control.pipes import check_pipe 
30   
31   
32 -def spectrum_type(spectrum_type=None, spectrum_id=None):
33 """Set the spectrum type corresponding to the spectrum_id. 34 35 @keyword spectrum_type: The type of NOE spectrum, one of 'ref' or 'sat'. 36 @type spectrum_type: str 37 @keyword spectrum_id: The spectrum id string. 38 @type spectrum_id: str 39 """ 40 41 # Test if the current pipe exists 42 check_pipe() 43 44 # Test the spectrum id string. 45 if spectrum_id not in cdp.spectrum_ids: 46 raise RelaxError("The peak intensities corresponding to the spectrum id '%s' does not exist." % spectrum_id) 47 48 # Initialise or update the spectrum_type data structure as necessary. 49 if not hasattr(cdp, 'spectrum_type'): 50 cdp.spectrum_type = {} 51 52 # Set the error. 53 cdp.spectrum_type[spectrum_id] = spectrum_type
54