mailr15049 - in /branches/frame_order_testing: maths_fns/frame_order.py 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 December 07, 2011 - 18:19:
Author: bugman
Date: Wed Dec  7 18:19:28 2011
New Revision: 15049

URL: http://svn.gna.org/viewcvs/relax?rev=15049&view=rev
Log:
The pivot point is now being passed into the frame order target function 
class.


Modified:
    branches/frame_order_testing/maths_fns/frame_order.py
    branches/frame_order_testing/specific_fns/frame_order.py

Modified: branches/frame_order_testing/maths_fns/frame_order.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/frame_order_testing/maths_fns/frame_order.py?rev=15049&r1=15048&r2=15049&view=diff
==============================================================================
--- branches/frame_order_testing/maths_fns/frame_order.py (original)
+++ branches/frame_order_testing/maths_fns/frame_order.py Wed Dec  7 18:19:28 
2011
@@ -46,7 +46,7 @@
 class Frame_order:
     """Class containing the target function of the optimisation of Frame 
Order matrix components."""
 
-    def __init__(self, model=None, init_params=None, full_tensors=None, 
full_in_ref_frame=None, rdcs=None, rdc_errors=None, rdc_weights=None, 
rdc_vect=None, rdc_const=None, pcs=None, pcs_errors=None, pcs_weights=None, 
pcs_atoms=None, temp=None, frq=None, paramag_centre=None, 
scaling_matrix=None, pivot_opt=False):
+    def __init__(self, model=None, init_params=None, full_tensors=None, 
full_in_ref_frame=None, rdcs=None, rdc_errors=None, rdc_weights=None, 
rdc_vect=None, rdc_const=None, pcs=None, pcs_errors=None, pcs_weights=None, 
pcs_atoms=None, temp=None, frq=None, paramag_centre=None, 
scaling_matrix=None, pivot=None, pivot_opt=False):
         """Set up the target functions for the Frame Order theories.
         
         @keyword model:             The name of the Frame Order model.
@@ -83,6 +83,8 @@
         @type paramag_centre:       numpy rank-1, 3D array or rank-2, Nx3 
array
         @keyword scaling_matrix:    The square and diagonal scaling matrix.
         @type scaling_matrix:       numpy rank-2 array
+        @keyword pivot:             The pivot point for the ball-and-socket 
joint motion.  This is needed if PCS or PRE values are used.
+        @type pivot:                numpy rank-1, 3D array or None
         @keyword pivot_opt:         A flag which if True will allow the 
pivot point of the motion to be optimised.
         @type pivot_opt:            bool
         """
@@ -109,6 +111,7 @@
         self.frq = frq
         self.paramag_centre = paramag_centre
         self.total_num_params = len(init_params)
+        self._param_pivot = pivot
         self.pivot_opt = pivot_opt
 
         # Tensor setup.
@@ -553,7 +556,7 @@
 
         # Unpack the parameters.
         if self.pivot_opt:
-            pivot = params[:3]
+            self._param_pivot = params[:3]
             ave_pos_alpha, ave_pos_beta, ave_pos_gamma, axis_theta, 
axis_phi, sigma_max = params[3:]
         else:
             ave_pos_alpha, ave_pos_beta, ave_pos_gamma, axis_theta, 
axis_phi, sigma_max = params
@@ -579,7 +582,7 @@
 
         # Pre-calculate all the necessary vectors.
         if self.pivot_opt:
-            self.calc_vectors(pivot)
+            self.calc_vectors(self._param_pivot)
 
         # Loop over each alignment.
         for i in xrange(self.num_align):

Modified: branches/frame_order_testing/specific_fns/frame_order.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/frame_order_testing/specific_fns/frame_order.py?rev=15049&r1=15048&r2=15049&view=diff
==============================================================================
--- branches/frame_order_testing/specific_fns/frame_order.py (original)
+++ branches/frame_order_testing/specific_fns/frame_order.py Wed Dec  7 
18:19:28 2011
@@ -1080,13 +1080,18 @@
         if 'rdc' in data_types:
             rdcs, rdc_err, rdc_weight, rdc_vect, rdc_const = 
self._minimise_setup_rdcs(sim_index=sim_index)
 
+        # The fixed pivot point.
+        pivot = None
+        if hasattr(cdp, 'pivot'):
+            pivot = cdp.pivot
+
         # Pivot optimisation.
         pivot_opt = True
         if self._pivot_fixed():
             pivot_opt = False
 
         # Set up the optimisation function.
-        target = frame_order.Frame_order(model=cdp.model, 
init_params=param_vector, full_tensors=full_tensors, 
full_in_ref_frame=full_in_ref_frame, rdcs=rdcs, rdc_errors=rdc_err, 
rdc_weights=rdc_weight, rdc_vect=rdc_vect, rdc_const=rdc_const, pcs=pcs, 
pcs_errors=pcs_err, pcs_weights=pcs_weight, pcs_atoms=pcs_atoms, temp=temp, 
frq=frq, paramag_centre=paramag_centre, scaling_matrix=scaling_matrix, 
pivot_opt=pivot_opt)
+        target = frame_order.Frame_order(model=cdp.model, 
init_params=param_vector, full_tensors=full_tensors, 
full_in_ref_frame=full_in_ref_frame, rdcs=rdcs, rdc_errors=rdc_err, 
rdc_weights=rdc_weight, rdc_vect=rdc_vect, rdc_const=rdc_const, pcs=pcs, 
pcs_errors=pcs_err, pcs_weights=pcs_weight, pcs_atoms=pcs_atoms, temp=temp, 
frq=frq, paramag_centre=paramag_centre, scaling_matrix=scaling_matrix, 
pivot=pivot, pivot_opt=pivot_opt)
 
         # Return the data.
         return target, param_vector, data_types, scaling_matrix




Related Messages


Powered by MHonArc, Updated Wed Dec 07 18:40:02 2011