mailr18983 - in /trunk: maths_fns/frame_order/ test_suite/shared_data/frame_order/cam/pseudo_ellipse/


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

Header


Content

Posted by edward on March 22, 2013 - 16:51:
Author: bugman
Date: Fri Mar 22 16:51:35 2013
New Revision: 18983

URL: http://svn.gna.org/viewcvs/relax?rev=18983&view=rev
Log:
Next block of the manual merger of the frame_order_testing branch.

The commands used were:
svn merge -r17950:17951 
svn+ssh://bugman@xxxxxxxxxxx/svn/relax/branches/frame_order_testing .
svn merge -r17951:17952 
svn+ssh://bugman@xxxxxxxxxxx/svn/relax/branches/frame_order_testing .
svn merge -r17952:17953 
svn+ssh://bugman@xxxxxxxxxxx/svn/relax/branches/frame_order_testing .
svn merge -r17953:17954 
svn+ssh://bugman@xxxxxxxxxxx/svn/relax/branches/frame_order_testing .
svn merge -r17955:17956 
svn+ssh://bugman@xxxxxxxxxxx/svn/relax/branches/frame_order_testing .
svn merge -r17956:17957 
svn+ssh://bugman@xxxxxxxxxxx/svn/relax/branches/frame_order_testing .
svn merge -r17957:17958 
svn+ssh://bugman@xxxxxxxxxxx/svn/relax/branches/frame_order_testing .
svn merge -r17958:17959 
svn+ssh://bugman@xxxxxxxxxxx/svn/relax/branches/frame_order_testing .

The console messages were:
[edau@localhost relax-trunk]$ svn merge -r17950:17951 
svn+ssh://bugman@xxxxxxxxxxx/svn/relax/branches/frame_order_testing .
--- Merging r17951 into '.':
U    maths_fns/frame_order/matrix_ops.py
[edau@localhost relax-trunk]$ svn merge -r17951:17952 
svn+ssh://bugman@xxxxxxxxxxx/svn/relax/branches/frame_order_testing .
--- Merging r17952 into '.':
U    maths_fns/frame_order/pseudo_ellipse.py
U    maths_fns/frame_order/__init__.py
[edau@localhost relax-trunk]$ svn merge -r17952:17953 
svn+ssh://bugman@xxxxxxxxxxx/svn/relax/branches/frame_order_testing .
--- Merging r17953 into '.':
G    maths_fns/frame_order/matrix_ops.py
[edau@localhost relax-trunk]$ svn merge -r17953:17954 
svn+ssh://bugman@xxxxxxxxxxx/svn/relax/branches/frame_order_testing .
--- Merging r17954 into '.':
G    maths_fns/frame_order/__init__.py
G    maths_fns/frame_order/matrix_ops.py
[edau@localhost relax-trunk]$ svn merge -r17955:17956 
svn+ssh://bugman@xxxxxxxxxxx/svn/relax/branches/frame_order_testing .
--- Merging r17956 into '.':
U    
test_suite/shared_data/frame_order/cam/pseudo_ellipse/multi_processor_test.py
A    test_suite/shared_data/frame_order/cam/pseudo_ellipse/pcs_dy_subset.txt
A    test_suite/shared_data/frame_order/cam/pseudo_ellipse/pcs_tm_subset.txt
A    test_suite/shared_data/frame_order/cam/pseudo_ellipse/pcs_tb_subset.txt
A    test_suite/shared_data/frame_order/cam/pseudo_ellipse/pcs_er_subset.txt
[edau@localhost relax-trunk]$ svn merge -r17956:17957 
svn+ssh://bugman@xxxxxxxxxxx/svn/relax/branches/frame_order_testing .
--- Merging r17957 into '.':
G    maths_fns/frame_order/matrix_ops.py
[edau@localhost relax-trunk]$ svn merge -r17957:17958 
svn+ssh://bugman@xxxxxxxxxxx/svn/relax/branches/frame_order_testing .
--- Merging r17958 into '.':
G    maths_fns/frame_order/pseudo_ellipse.py
[edau@localhost relax-trunk]$ svn merge -r17958:17959 
svn+ssh://bugman@xxxxxxxxxxx/svn/relax/branches/frame_order_testing .
Conflict discovered in 'auto_analyses/dauvergne_protocol.py'.
Select: (p) postpone, (df) diff-full, (e) edit,
        (mc) mine-conflict, (tc) theirs-conflict,
        (s) show all options: p
--- Merging r17959 into '.':
C    auto_analyses/dauvergne_protocol.py
Summary of conflicts:
  Text conflicts: 1
[edau@localhost relax-trunk]$


Added:
    
trunk/test_suite/shared_data/frame_order/cam/pseudo_ellipse/pcs_dy_subset.txt
      - copied unchanged from r17956, 
branches/frame_order_testing/test_suite/shared_data/frame_order/cam/pseudo_ellipse/pcs_dy_subset.txt
    
trunk/test_suite/shared_data/frame_order/cam/pseudo_ellipse/pcs_er_subset.txt
      - copied unchanged from r17956, 
branches/frame_order_testing/test_suite/shared_data/frame_order/cam/pseudo_ellipse/pcs_er_subset.txt
    
trunk/test_suite/shared_data/frame_order/cam/pseudo_ellipse/pcs_tb_subset.txt
      - copied unchanged from r17956, 
branches/frame_order_testing/test_suite/shared_data/frame_order/cam/pseudo_ellipse/pcs_tb_subset.txt
    
trunk/test_suite/shared_data/frame_order/cam/pseudo_ellipse/pcs_tm_subset.txt
      - copied unchanged from r17956, 
branches/frame_order_testing/test_suite/shared_data/frame_order/cam/pseudo_ellipse/pcs_tm_subset.txt
Modified:
    trunk/maths_fns/frame_order/__init__.py
    trunk/maths_fns/frame_order/matrix_ops.py
    trunk/maths_fns/frame_order/pseudo_ellipse.py
    
trunk/test_suite/shared_data/frame_order/cam/pseudo_ellipse/multi_processor_test.py

Modified: trunk/maths_fns/frame_order/__init__.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/maths_fns/frame_order/__init__.py?rev=18983&r1=18982&r2=18983&view=diff
==============================================================================
--- trunk/maths_fns/frame_order/__init__.py (original)
+++ trunk/maths_fns/frame_order/__init__.py Fri Mar 22 16:51:35 2013
@@ -51,8 +51,7 @@
 from maths_fns.kronecker_product import kron_prod
 from maths_fns import order_parameters
 from maths_fns.pcs import pcs_tensor
-from maths_fns.rotation_matrix import euler_to_R_zyz
-from maths_fns.rotation_matrix import two_vect_to_R
+from maths_fns.rotation_matrix import euler_to_R_zyz, tilt_torsion_to_R, 
two_vect_to_R
 from maths_fns.rdc import rdc_tensor
 from multi import fetch_data, Processor_box
 from physical_constants import pcs_constant
@@ -334,15 +333,28 @@
                 self.create_sobol_data(n=self.num_int_pts, dims=['sigma'])
                 self.func = self.func_free_rotor_qrint
 
+            # Pre-calculate the rotation matrices Ri_prime from the Sobol' 
angles.
+            for i in range(self.num_int_pts):
+                # Unpack the angles.
+                theta, phi, sigma = self.sobol_angles[i]
+
+                # The rotation matrix.
+                tilt_torsion_to_R(phi, theta, sigma, self.Ri_prime[i])
+
             # Subdivide the Sobol' data points for the slave processors.
-            blocks = []
+            blocks_sobol = []
             for block in self.subdivide(self.sobol_angles, 
self.processor.processor_size()):
-                blocks.append(block)
+                blocks_sobol.append(block)
+
+            # Subdivide the Ri prime data.
+            blocks_Ri_prime = []
+            for block in self.subdivide(self.Ri_prime, 
self.processor.processor_size()):
+                blocks_Ri_prime.append(block)
 
             # Set up the slave processors.
             self.slaves = []
             for i in range(self.processor.processor_size()):
-                
self.slaves.append(Slave_command_pcs_pseudo_ellipse_qrint(blocks[i], 
full_in_ref_frame=self.full_in_ref_frame, r_ln_pivot=self.r_ln_pivot, 
A=self.A_3D, Ri_prime=self.Ri_prime, pcs_theta=self.pcs_theta, 
pcs_theta_err=self.pcs_theta_err, missing_pcs=self.missing_pcs))
+                
self.slaves.append(Slave_command_pcs_pseudo_ellipse_qrint(blocks_sobol[i], 
full_in_ref_frame=self.full_in_ref_frame, r_ln_pivot=self.r_ln_pivot, 
A=self.A_3D, Ri_prime=blocks_Ri_prime[i], pcs_theta=self.pcs_theta, 
pcs_theta_err=self.pcs_theta_err, missing_pcs=self.missing_pcs))
 
         # The target function aliases (Scipy numerical integration).
         else:
@@ -390,7 +402,7 @@
         # The rotation to the Frame Order eigenframe.
         self.R_eigen = zeros((3, 3), float64)
         self.R_ave = zeros((3, 3), float64)
-        self.Ri_prime = zeros((3, 3), float64)
+        self.Ri_prime = zeros((self.num_int_pts, 3, 3), float64)
         self.tensor_3D = zeros((3, 3), float64)
 
         # The cone axis storage and molecular frame z-axis.

Modified: trunk/maths_fns/frame_order/matrix_ops.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/maths_fns/frame_order/matrix_ops.py?rev=18983&r1=18982&r2=18983&view=diff
==============================================================================
--- trunk/maths_fns/frame_order/matrix_ops.py (original)
+++ trunk/maths_fns/frame_order/matrix_ops.py Fri Mar 22 16:51:35 2013
@@ -24,7 +24,7 @@
 
 # Python module imports.
 from math import cos, sin, sqrt
-from numpy import dot, float64, inner, transpose, zeros
+from numpy import dot, inner, transpose
 from numpy.linalg import norm
 
 # relax module imports.
@@ -152,15 +152,9 @@
     return pcs
 
 
-def pcs_pivot_motion_full_qrint(theta_i=None, phi_i=None, sigma_i=None, 
full_in_ref_frame=None, r_pivot_atom=None, r_pivot_atom_rev=None, 
r_ln_pivot=None, A=None, R_eigen=None, RT_eigen=None, Ri_prime=None, 
pcs_theta=None, pcs_theta_err=None, missing_pcs=None, error_flag=False):
+def pcs_pivot_motion_full_qrint(full_in_ref_frame=None, r_pivot_atom=None, 
r_pivot_atom_rev=None, r_ln_pivot=None, A=None, R_eigen=None, RT_eigen=None, 
Ri_prime=None, pcs_theta=None, pcs_theta_err=None, missing_pcs=None, 
error_flag=False):
     """Calculate the PCS value after a pivoted motion for the isotropic cone 
model.
 
-    @keyword theta_i:           The half cone opening angle (polar angle).
-    @type theta_i:              float
-    @keyword phi_i:             The cone azimuthal angle.
-    @type phi_i:                float
-    @keyword sigma_i:           The torsion angle for state i.
-    @type sigma_i:              float
     @keyword full_in_ref_frame: An array of flags specifying if the tensor 
in the reference frame is the full or reduced tensor.
     @type full_in_ref_frame:    numpy rank-1 array
     @keyword r_pivot_atom:      The pivot point to atom vector.
@@ -187,11 +181,19 @@
     @type error_flag:           bool
     """
 
-    # The vectors.
-    rot_vect, rot_vect_rev, length, length_rev = 
vectors_pivot_motion_full(theta_i=theta_i, phi_i=phi_i, sigma_i=sigma_i, 
r_pivot_atom=r_pivot_atom, r_pivot_atom_rev=r_pivot_atom_rev, 
r_ln_pivot=r_ln_pivot, R_eigen=R_eigen, RT_eigen=RT_eigen, Ri_prime=Ri_prime)
+    # The rotation.
+    R_i = dot(R_eigen, dot(Ri_prime, RT_eigen))
+
+    # Pre-calculate all the new vectors (forwards and reverse).
+    rot_vect_rev = transpose(dot(R_i, r_pivot_atom_rev) + r_ln_pivot)
+    rot_vect = transpose(dot(R_i, r_pivot_atom) + r_ln_pivot)
 
     # Loop over the atoms.
     for j in range(len(r_pivot_atom[0])):
+        # The vector length (to the 5th power).
+        length_rev = 1.0 / sqrt(inner(rot_vect_rev[j], rot_vect_rev[j]))**5
+        length = 1.0 / sqrt(inner(rot_vect[j], rot_vect[j]))**5
+
         # Loop over the alignments.
         for i in range(len(pcs_theta)):
             # Skip missing data.
@@ -201,10 +203,10 @@
             # The projection.
             if full_in_ref_frame[i]:
                 proj = dot(rot_vect_rev[j], dot(A[i], rot_vect_rev[j]))
-                length_i = length_rev[j]
+                length_i = length_rev
             else:
                 proj = dot(rot_vect[j], dot(A[i], rot_vect[j]))
-                length_i = length[j]
+                length_i = length
 
             # The PCS.
             pcs_theta[i, j] += proj * length_i
@@ -449,70 +451,5 @@
     return matrix_rot
 
 
-def vectors_pivot_motion_full(theta_i=None, phi_i=None, sigma_i=None, 
r_pivot_atom=None, r_pivot_atom_rev=None, r_ln_pivot=None, R_eigen=None, 
RT_eigen=None, Ri_prime=None):
-    """Calculate the lanthanide to atom vectors.
-
-    @keyword theta_i:           The half cone opening angle (polar angle).
-    @type theta_i:              float
-    @keyword phi_i:             The cone azimuthal angle.
-    @type phi_i:                float
-    @keyword sigma_i:           The torsion angle for state i.
-    @type sigma_i:              float
-    @keyword r_pivot_atom:      The pivot point to atom vector.
-    @type r_pivot_atom:         numpy rank-2, 3D array
-    @keyword r_pivot_atom_rev:  The reversed pivot point to atom vector.
-    @type r_pivot_atom_rev:     numpy rank-2, 3D array
-    @keyword r_ln_pivot:        The lanthanide position to pivot point 
vector.
-    @type r_ln_pivot:           numpy rank-2, 3D array
-    @keyword R_eigen:           The eigenframe rotation matrix.
-    @type R_eigen:              numpy rank-2, 3D array
-    @keyword RT_eigen:          The transpose of the eigenframe rotation 
matrix (for faster calculations).
-    @type RT_eigen:             numpy rank-2, 3D array
-    @keyword Ri_prime:          The empty rotation matrix for the in-frame 
isotropic cone motion for state i.
-    @type Ri_prime:             numpy rank-2, 3D array
-    @return:                    The vectors, reverse vectors, vector 
lengths, and reverse vector lengths.
-    @rtype:                     tuple of numpy rank-2, 3D array
-    """
-
-    # The rotation matrix.
-    c_theta = cos(theta_i)
-    s_theta = sin(theta_i)
-    c_phi = cos(phi_i)
-    s_phi = sin(phi_i)
-    c_sigma_phi = cos(sigma_i - phi_i)
-    s_sigma_phi = sin(sigma_i - phi_i)
-    c_phi_c_theta = c_phi * c_theta
-    s_phi_c_theta = s_phi * c_theta
-    Ri_prime[0, 0] =  c_phi_c_theta*c_sigma_phi - s_phi*s_sigma_phi
-    Ri_prime[0, 1] = -c_phi_c_theta*s_sigma_phi - s_phi*c_sigma_phi
-    Ri_prime[0, 2] =  c_phi*s_theta
-    Ri_prime[1, 0] =  s_phi_c_theta*c_sigma_phi + c_phi*s_sigma_phi
-    Ri_prime[1, 1] = -s_phi_c_theta*s_sigma_phi + c_phi*c_sigma_phi
-    Ri_prime[1, 2] =  s_phi*s_theta
-    Ri_prime[2, 0] = -s_theta*c_sigma_phi
-    Ri_prime[2, 1] =  s_theta*s_sigma_phi
-    Ri_prime[2, 2] =  c_theta
-
-    # The rotation.
-    R_i = dot(R_eigen, dot(Ri_prime, RT_eigen))
-
-    # Pre-calculate all the new vectors (forwards and reverse).
-    rot_vect_rev = transpose(dot(R_i, r_pivot_atom_rev) + r_ln_pivot)
-    rot_vect = transpose(dot(R_i, r_pivot_atom) + r_ln_pivot)
-
-    # Initialise the lengths.
-    length = zeros(len(r_pivot_atom[0]), float64)
-    length_rev = zeros(len(r_pivot_atom[0]), float64)
-
-    # Loop over the atoms.
-    for j in range(len(r_pivot_atom[0])):
-        # The vector length (to the 5th power).
-        length[j] = 1.0 / sqrt(inner(rot_vect[j], rot_vect[j]))**5
-        length_rev[j] = 1.0 / sqrt(inner(rot_vect_rev[j], 
rot_vect_rev[j]))**5
-
-    # Return the data.
-    return rot_vect, rot_vect_rev, length, length_rev
-
-
 class Data:
     """A data container stored in the memo objects for use by the 
Result_command class."""

Modified: trunk/maths_fns/frame_order/pseudo_ellipse.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/maths_fns/frame_order/pseudo_ellipse.py?rev=18983&r1=18982&r2=18983&view=diff
==============================================================================
--- trunk/maths_fns/frame_order/pseudo_ellipse.py (original)
+++ trunk/maths_fns/frame_order/pseudo_ellipse.py Fri Mar 22 16:51:35 2013
@@ -733,7 +733,7 @@
         @type r_ln_pivot:           numpy rank-2, 3D array
         @keyword A:                 The full alignment tensor of the 
non-moving domain.
         @type A:                    numpy rank-2, 3D array
-        @keyword Ri_prime:          The empty rotation matrix for the 
in-frame isotropic cone motion, used to calculate the PCS for each state i in 
the numerical integration.
+        @keyword Ri_prime:          The subdivision of rotation matrices 
used to calculate the PCS for each state i in the numerical integration.
         @type Ri_prime:             numpy rank-2, 3D array
         @keyword pcs_theta:         The storage structure for the 
back-calculated PCS values.
         @type pcs_theta:            numpy rank-2 array
@@ -808,7 +808,7 @@
                 continue
 
             # Calculate the PCSs for this state.
-            pcs_pivot_motion_full_qrint(theta_i=theta, phi_i=phi, 
sigma_i=sigma, full_in_ref_frame=self.full_in_ref_frame, 
r_pivot_atom=self.r_pivot_atom, r_pivot_atom_rev=self.r_pivot_atom_rev, 
r_ln_pivot=self.r_ln_pivot, A=self.A, R_eigen=self.R_eigen, 
RT_eigen=self.RT_eigen, Ri_prime=self.Ri_prime, pcs_theta=self.pcs_theta, 
pcs_theta_err=self.pcs_theta_err, missing_pcs=self.missing_pcs)
+            
pcs_pivot_motion_full_qrint(full_in_ref_frame=self.full_in_ref_frame, 
r_pivot_atom=self.r_pivot_atom, r_pivot_atom_rev=self.r_pivot_atom_rev, 
r_ln_pivot=self.r_ln_pivot, A=self.A, R_eigen=self.R_eigen, 
RT_eigen=self.RT_eigen, Ri_prime=self.Ri_prime[i], pcs_theta=self.pcs_theta, 
pcs_theta_err=self.pcs_theta_err, missing_pcs=self.missing_pcs)
 
             # Increment the number of points.
             num += 1

Modified: 
trunk/test_suite/shared_data/frame_order/cam/pseudo_ellipse/multi_processor_test.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/test_suite/shared_data/frame_order/cam/pseudo_ellipse/multi_processor_test.py?rev=18983&r1=18982&r2=18983&view=diff
==============================================================================
--- 
trunk/test_suite/shared_data/frame_order/cam/pseudo_ellipse/multi_processor_test.py
 (original)
+++ 
trunk/test_suite/shared_data/frame_order/cam/pseudo_ellipse/multi_processor_test.py
 Fri Mar 22 16:51:35 2013
@@ -37,7 +37,7 @@
 ln = ['dy', 'tb', 'tm', 'er']
 for i in range(len(ln)):
     # Load the RDCs.
-    #rdc.read(align_id=ln[i], file='rdc_%s.txt'%ln[i], spin_id1_col=1, 
spin_id2_col=2, data_col=3, error_col=4)
+    rdc.read(align_id=ln[i], file='rdc_%s.txt'%ln[i], spin_id1_col=1, 
spin_id2_col=2, data_col=3, error_col=4)
 
     # The PCS.
     pcs.read(align_id=ln[i], file='pcs_%s.txt'%ln[i], mol_name_col=1, 
res_num_col=2, spin_name_col=5, data_col=6, error_col=7)
@@ -92,9 +92,9 @@
 value.set(param='eigen_alpha', val=3.14159265358979311600+0.1)
 value.set(param='eigen_beta', val=0.96007997859534310869+0.1)
 value.set(param='eigen_gamma', val=4.03227550621962294031+0.1)
-value.set(param='cone_theta_x', val=30.0 * 2.0 * pi / 360.0+0.1)
-value.set(param='cone_theta_y', val=50.0 * 2.0 * pi / 360.0+0.1)
-value.set(param='cone_sigma_max', val=60.0 * 2.0 * pi / 360.0+0.1)
+value.set(param='cone_theta_x', val=30.0 * 2.0 * pi / 360.0+0.5)
+value.set(param='cone_theta_y', val=50.0 * 2.0 * pi / 360.0+0.5)
+value.set(param='cone_sigma_max', val=60.0 * 2.0 * pi / 360.0+0.5)
 calc()
 print("\nchi2: %s" % repr(cdp.chi2))
 




Related Messages


Powered by MHonArc, Updated Fri Mar 22 17:00:02 2013