mailr9162 - /branches/frame_order/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 June 29, 2009 - 10:24:
Author: bugman
Date: Mon Jun 29 10:24:03 2009
New Revision: 9162

URL: http://svn.gna.org/viewcvs/relax?rev=9162&view=rev
Log:
Wrote the calculate() method for calculating the chi-squared value for the 
current parameters.


Modified:
    branches/frame_order/specific_fns/frame_order.py

Modified: branches/frame_order/specific_fns/frame_order.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/frame_order/specific_fns/frame_order.py?rev=9162&r1=9161&r2=9162&view=diff
==============================================================================
--- branches/frame_order/specific_fns/frame_order.py (original)
+++ branches/frame_order/specific_fns/frame_order.py Mon Jun 29 10:24:03 2009
@@ -269,6 +269,30 @@
         """
 
         yield None
+
+
+    def calculate(self, verbosity=None):
+        """Calculate the chi-squared value for the current parameter 
values."""
+
+        # Alias the current data pipe.
+        cdp = pipes.get_pipe()
+
+        # Isotropic cone model.
+        if cdp.model == 'iso cone':
+            # The initial parameter vector (the cone axis angles and the 
cone angle).
+            param_vector = array([cdp.theta_axis, cdp.phi_axis, 
cdp.theta_cone], float64)
+
+            # Get the data structures for optimisation using the tensors as 
base data sets.
+            full_tensors, red_tensors, red_tensor_err = 
self.__minimise_setup_tensors()
+
+            # Set up the optimisation function.
+            target = frame_order_models.Frame_order(model=cdp.model, 
full_tensors=full_tensors, red_tensors=red_tensors, red_errors=red_tensor_err)
+
+            # Make a single function call.  This will cause back calculation 
and the data will be stored in the class instance.
+            chi2 = target.func(param_vector)
+
+        # Set the chi2.
+        cdp.chi2 = chi2
 
 
     def cone_pdb(self, size=30.0, file=None, dir=None, inc=40, force=False):




Related Messages


Powered by MHonArc, Updated Mon Jun 29 10:40:03 2009