mailr7196 - /branches/rdc_analysis/generic_fns/pcs.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on August 14, 2008 - 18:14:
Author: bugman
Date: Thu Aug 14 16:52:06 2008
New Revision: 7196

URL: http://svn.gna.org/viewcvs/relax?rev=7196&view=rev
Log:
The data pipe arg is now accepted by the centre() function.


Modified:
    branches/rdc_analysis/generic_fns/pcs.py

Modified: branches/rdc_analysis/generic_fns/pcs.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/rdc_analysis/generic_fns/pcs.py?rev=7196&r1=7195&r2=7196&view=diff
==============================================================================
--- branches/rdc_analysis/generic_fns/pcs.py (original)
+++ branches/rdc_analysis/generic_fns/pcs.py Thu Aug 14 16:52:06 2008
@@ -211,30 +211,33 @@
         self.update_data_structures_spin(data, ri_label, frq_label, frq, 
value)
 
 
-def centre(atom_id=None):
+def centre(atom_id=None, pipe=None):
     """Specify the atom in the loaded structure corresponding to the 
paramagnetic centre.
 
     @keyword atom_id:   The atom identification string.
     @type atom_id:      str
     """
 
-    # Test if the current data pipe exists.
-    if not ds.current_pipe:
-        raise RelaxNoPipeError
-
-    # Alias the current data pipe.
-    cdp = ds[ds.current_pipe]
+    # The data pipe.
+    if pipe == None:
+        pipe = ds.current_pipe
+
+    # Test the data pipe.
+    pipes.test(pipe)
+
+    # Alias the data pipe.
+    dp = ds[pipe]
 
     # Test if the structure has been loaded.
-    if not hasattr(cdp, 'structure'):
+    if not hasattr(dp, 'structure'):
         raise RelaxNoPdbError
 
     # Test the centre has already been set.
-    if hasattr(cdp, 'paramagnetic_centre'):
-        raise RelaxError, "The paramagnetic centre has already been set to 
the atom " + `cdp.paramagnetic_centre` + "."
+    if hasattr(dp, 'paramagnetic_centre'):
+        raise RelaxError, "The paramagnetic centre has already been set to 
the atom " + `dp.paramagnetic_centre` + "."
 
     # Set the centre.
-    cdp.paramagnetic_centre = atom_id
+    dp.paramagnetic_centre = atom_id
 
 
 def copy(pipe_from=None, pipe_to=None, ri_label=None, frq_label=None):




Related Messages


Powered by MHonArc, Updated Thu Aug 14 19:20:30 2008