mailr9095 - /branches/frame_order/maths_fns/frame_order_models.py


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

Header


Content

Posted by edward on June 19, 2009 - 11:50:
Author: bugman
Date: Fri Jun 19 11:50:26 2009
New Revision: 9095

URL: http://svn.gna.org/viewcvs/relax?rev=9095&view=rev
Log:
Modified the __init__() method and spun of some code into 
__init_iso_cone_elements().


Modified:
    branches/frame_order/maths_fns/frame_order_models.py

Modified: branches/frame_order/maths_fns/frame_order_models.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/frame_order/maths_fns/frame_order_models.py?rev=9095&r1=9094&r2=9095&view=diff
==============================================================================
--- branches/frame_order/maths_fns/frame_order_models.py (original)
+++ branches/frame_order/maths_fns/frame_order_models.py Fri Jun 19 11:50:26 
2009
@@ -36,7 +36,7 @@
 class Frame_order:
     """Class containing the target function of the optimisation of Frame 
Order matrix components."""
 
-    def __init__(self, frame_order_2nd=None):
+    def __init__(self, model=None, frame_order_2nd=None):
         """Set up the target functions for the Frame Order theories.
         
         @keyword frame_order_2nd:   The numerical values of the 2nd degree 
Frame Order matrix.  If
@@ -45,23 +45,40 @@
         @type frame_order_2nd:      None or numpy 9D, rank-2 array
         """
 
-        # Optimisation to the 2nd degree Frame Order matrix components 
directly.
-        if frame_order_2nd != None:
-            # Store the real matrix components.
-            self.data = frame_order_2nd
+        # Model test.
+        if not model:
+            raise RelaxError, "The type of Frame Order model must be 
specified."
 
-            # The errors.
-            self.errors = ones((9, 9), float64)
+        # Isotropic cone model.
+        if model == 'iso cone':
+            # Optimisation to the 2nd degree Frame Order matrix components 
directly.
+            if frame_order_2nd != None:
+                self.__init_iso_cone_elements(frame_order_2nd)
 
-            # The rotation.
-            self.rot = zeros((3, 3), float64)
 
-            # Initialise the Frame Order matrices.
-            self.frame_order_1st = zeros((3, 3), float64)
-            self.frame_order_2nd = zeros((9, 9), float64)
+    def __init_iso_cone_elements(self, frame_order_2nd):
+        """Set up isotropic cone optimisation against the 2nd degree Frame 
Order matrix elements.
+        
+        @keyword frame_order_2nd:   The numerical values of the 2nd degree 
Frame Order matrix.  If
+                                    supplied, the target functions will 
optimise directly to these
+                                    values.
+        @type frame_order_2nd:      numpy 9D, rank-2 array
+        """
 
-            # Alias the target function.
-            self.func = self.func_iso_cone_elements
+        # Store the real matrix components.
+        self.data = frame_order_2nd
+
+        # The errors.
+        self.errors = ones((9, 9), float64)
+
+        # The rotation.
+        self.rot = zeros((3, 3), float64)
+
+        # Initialise the Frame Order matrices.
+        self.frame_order_2nd = zeros((9, 9), float64)
+
+        # Alias the target function.
+        self.func = self.func_iso_cone_elements
 
 
     def func_iso_cone_elements(self, params):




Related Messages


Powered by MHonArc, Updated Fri Jun 19 12:00:05 2009