mailr22177 - in /branches/double_rotor: specific_analyses/frame_order/optimisation.py target_functions/frame_order.py


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

Header


Content

Posted by edward on February 12, 2014 - 16:20:
Author: bugman
Date: Wed Feb 12 16:20:38 2014
New Revision: 22177

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


Modified:
    branches/double_rotor/specific_analyses/frame_order/optimisation.py
    branches/double_rotor/target_functions/frame_order.py

Modified: branches/double_rotor/specific_analyses/frame_order/optimisation.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/double_rotor/specific_analyses/frame_order/optimisation.py?rev=22177&r1=22176&r2=22177&view=diff
==============================================================================
--- branches/double_rotor/specific_analyses/frame_order/optimisation.py 
(original)
+++ branches/double_rotor/specific_analyses/frame_order/optimisation.py Wed 
Feb 12 16:20:38 2014
@@ -669,6 +669,11 @@
     if hasattr(cdp, 'pivot'):
         pivot = cdp.pivot
 
+    # The second pivot.
+    pivot2 = None
+    if hasattr(cdp, 'pivot2'):
+        pivot2 = cdp.pivot2
+
     # Pivot optimisation.
     pivot_opt = True
     if pivot_fixed():
@@ -704,7 +709,7 @@
         sys.stdout.write("Base data: %s\n" % repr(base_data))
 
     # 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, dip_const=rdc_const, pcs=pcs, 
pcs_errors=pcs_err, pcs_weights=pcs_weight, atomic_pos=atomic_pos, temp=temp, 
frq=frq, paramag_centre=paramag_centre, scaling_matrix=scaling_matrix, 
ave_pos_pivot=com, ave_pos_piv_sync=ave_pos_piv_sync, 
translation_opt=translation_opt, pivot=pivot, pivot_opt=pivot_opt, 
num_int_pts=cdp.num_int_pts, quad_int=cdp.quad_int)
+    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, dip_const=rdc_const, pcs=pcs, 
pcs_errors=pcs_err, pcs_weights=pcs_weight, atomic_pos=atomic_pos, temp=temp, 
frq=frq, paramag_centre=paramag_centre, scaling_matrix=scaling_matrix, 
ave_pos_pivot=com, ave_pos_piv_sync=ave_pos_piv_sync, 
translation_opt=translation_opt, pivot=pivot, pivot2=pivot2, 
pivot_opt=pivot_opt, num_int_pts=cdp.num_int_pts, quad_int=cdp.quad_int)
 
     # Return the data.
     return target, param_vector, data_types, scaling_matrix

Modified: branches/double_rotor/target_functions/frame_order.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/double_rotor/target_functions/frame_order.py?rev=22177&r1=22176&r2=22177&view=diff
==============================================================================
--- branches/double_rotor/target_functions/frame_order.py (original)
+++ branches/double_rotor/target_functions/frame_order.py Wed Feb 12 16:20:38 
2014
@@ -56,7 +56,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, dip_const=None, pcs=None, pcs_errors=None, pcs_weights=None, 
atomic_pos=None, temp=None, frq=None, paramag_centre=zeros(3), 
scaling_matrix=None, num_int_pts=500, ave_pos_pivot=zeros(3), 
ave_pos_piv_sync=True, translation_opt=False, pivot=zeros(3), 
pivot_opt=False, quad_int=True):
+    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, dip_const=None, pcs=None, pcs_errors=None, pcs_weights=None, 
atomic_pos=None, temp=None, frq=None, paramag_centre=zeros(3), 
scaling_matrix=None, num_int_pts=500, ave_pos_pivot=zeros(3), 
ave_pos_piv_sync=True, translation_opt=False, pivot=None, pivot2=None, 
pivot_opt=False, quad_int=True):
         """Set up the target functions for the Frame Order theories.
 
         @keyword model:             The name of the Frame Order model.
@@ -103,6 +103,8 @@
         @type translation_opt:      bool
         @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 pivot2:            The second pivot point for the motion.  
This is needed if PCS or PRE values are used and if a double-motional model 
is to be optimised.
+        @type pivot2:               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
         @keyword quad_int:          A flag which if True will perform high 
precision numerical integration via the scipy.integrate quad(), dblquad() and 
tplquad() integration methods rather than the rough quasi-random numerical 
integration.
@@ -136,6 +138,7 @@
         self.ave_pos_piv_sync = ave_pos_piv_sync
         self.translation_opt = translation_opt
         self._param_pivot = pivot
+        self._param_pivot2 = pivot2
         self.pivot_opt = pivot_opt
 
         # Tensor setup.
@@ -422,7 +425,7 @@
         # Unpack the parameters.
         if self.translation_opt and self.pivot_opt:
             self._param_pivot = params[:3]
-            self._param_pivot_2 = params[3:6]
+            self._param_pivot2 = params[3:6]
             self._translation_vector = params[6:9]
             ave_pos_alpha, ave_pos_beta, ave_pos_gamma, axis_theta, 
axis_phi, axis_theta_2, axis_phi_2, sigma_max, sigma_max_2 = params[9:]
         elif self.translation_opt:
@@ -430,7 +433,7 @@
             ave_pos_alpha, ave_pos_beta, ave_pos_gamma, axis_theta, 
axis_phi, axis_theta_2, axis_phi_2, sigma_max, sigma_max_2 = params[3:]
         elif self.pivot_opt:
             self._param_pivot = params[:3]
-            self._param_pivot_2 = params[3:6]
+            self._param_pivot2 = params[3:6]
             ave_pos_alpha, ave_pos_beta, ave_pos_gamma, axis_theta, 
axis_phi, axis_theta_2, axis_phi_2, sigma_max, sigma_max_2 = params[6:]
         else:
             ave_pos_alpha, ave_pos_beta, ave_pos_gamma, axis_theta, 
axis_phi, axis_theta_2, axis_phi_2, sigma_max, sigma_max_2 = params




Related Messages


Powered by MHonArc, Updated Thu Feb 13 10:00:02 2014