mailr9328 - /1.3/specific_fns/frame_order.py


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

Header


Content

Posted by edward on August 18, 2009 - 14:42:
Author: bugman
Date: Tue Aug 18 14:42:41 2009
New Revision: 9328

URL: http://svn.gna.org/viewcvs/relax?rev=9328&view=rev
Log:
Implemented the back end of the frame_order.ref_domain() user function.


Modified:
    1.3/specific_fns/frame_order.py

Modified: 1.3/specific_fns/frame_order.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/specific_fns/frame_order.py?rev=9328&r1=9327&r2=9328&view=diff
==============================================================================
--- 1.3/specific_fns/frame_order.py (original)
+++ 1.3/specific_fns/frame_order.py Tue Aug 18 14:42:41 2009
@@ -681,6 +681,38 @@
             cdp.pivot[i] = float(cdp.pivot[i])
 
 
+    def ref_domain(self, ref=None):
+        """Set the reference domain for the frame order, multi-domain models.
+
+        @param ref: The reference domain.
+        @type ref:  str
+        """
+
+        # Test if the current data pipe exists.
+        pipes.test()
+
+        # Alias the current data pipe.
+        cdp = pipes.get_pipe()
+
+        # Test if the model is setup.
+        if not hasattr(cdp, 'model'):
+            raise RelaxNoModelError, 'Frame order'
+
+        # Test if the reference domain exists.
+        exists = False
+        for tensor_cont in cdp.align_tensors:
+            if tensor_cont.domain == ref:
+                exists = True
+        if not exists:
+            raise RelaxError, "The reference domain cannot be found within 
any of the loaded tensors."
+
+        # Set the reference domain.
+        cdp.ref_domain = ref
+
+        # Update the model.
+        self.__update_model()
+
+
     def return_error(self, index):
         """Return the alignment tensor error structure.
 




Related Messages


Powered by MHonArc, Updated Tue Aug 18 15:20:05 2009