mailr17897 - /branches/frame_order_testing/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 October 17, 2012 - 15:03:
Author: bugman
Date: Wed Oct 17 15:03:30 2012
New Revision: 17897

URL: http://svn.gna.org/viewcvs/relax?rev=17897&view=rev
Log:
All of the alignment tensor data from the frame order base data loop methods 
have been removed.

This also includes the assembly of the alignment tensor data.


Modified:
    branches/frame_order_testing/specific_fns/frame_order.py

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=17897&r1=17896&r2=17897&view=diff
==============================================================================
--- branches/frame_order_testing/specific_fns/frame_order.py (original)
+++ branches/frame_order_testing/specific_fns/frame_order.py Wed Oct 17 
15:03:30 2012
@@ -390,7 +390,7 @@
             # The axis.
             axis = zeros(3, float64)
             spherical_to_cartesian([1.0, getattr(cdp, 'axis_theta'), 
getattr(cdp, 'axis_phi')], axis)
-            print("Central axis: %s." % axis)
+            print(("Central axis: %s." % axis))
 
             # Rotations and inversions.
             axis_pos = axis
@@ -427,7 +427,7 @@
             # The axis system.
             axes = zeros((3, 3), float64)
             euler_to_R_zyz(cdp.eigen_alpha, cdp.eigen_beta, cdp.eigen_gamma, 
axes)
-            print("Axis system:\n%s" % axes)
+            print(("Axis system:\n%s" % axes))
 
             # Rotations and inversions.
             axes_pos = axes
@@ -933,21 +933,12 @@
 
         # Loop over the full tensors.
         for i, tensor in self._tensor_loop(red=False):
-            # The full tensor (simulation data).
-            if sim_index != None:
-                full_tensors[5*i + 0] = tensor.Axx_sim[sim_index]
-                full_tensors[5*i + 1] = tensor.Ayy_sim[sim_index]
-                full_tensors[5*i + 2] = tensor.Axy_sim[sim_index]
-                full_tensors[5*i + 3] = tensor.Axz_sim[sim_index]
-                full_tensors[5*i + 4] = tensor.Ayz_sim[sim_index]
-
             # The full tensor.
-            else:
-                full_tensors[5*i + 0] = tensor.Axx
-                full_tensors[5*i + 1] = tensor.Ayy
-                full_tensors[5*i + 2] = tensor.Axy
-                full_tensors[5*i + 3] = tensor.Axz
-                full_tensors[5*i + 4] = tensor.Ayz
+            full_tensors[5*i + 0] = tensor.Axx
+            full_tensors[5*i + 1] = tensor.Ayy
+            full_tensors[5*i + 2] = tensor.Axy
+            full_tensors[5*i + 3] = tensor.Axz
+            full_tensors[5*i + 4] = tensor.Ayz
 
             # The full tensor corresponds to the frame of reference.
             if cdp.ref_domain == tensor.domain:
@@ -1533,14 +1524,14 @@
     def base_data_loop(self):
         """Generator method for looping over the base data - alignment 
tensors, RDCs, PCSs.
 
-        This loop first yields the string 'A' representing the alignment 
tensors, and then iterates for each data point (RDC, PCS) for each spin, 
returning the identification information.
-
-        @return:    The alignment tensor or a list of the spin ID string, 
the data type ('rdc', 'pcs') and the alignment ID.
-        @rtype:     string or list of str
-        """
-
-        # First the tensors.
-        yield 'A'
+        This loop yields the following:
+
+            - The RDC identification data for the interatomic data container 
and alignment.
+            - The PCS identification data for the spin data container and 
alignment.
+
+        @return:    The base data type ('rdc' or 'pcs'), the spin or 
interatomic data container information (either one or two spin IDs), and the 
alignment ID string.
+        @rtype:     list of str
+        """
 
         # The moving domain ID.
         id = cdp.domain[self._domain_moving()]
@@ -1604,7 +1595,7 @@
         """Create the Monte Carlo data by back calculating the reduced 
tensor data.
 
         @keyword data_id:   The data set as yielded by the base_data_loop() 
generator method.
-        @type data_id:      str or list of str
+        @type data_id:      list of str
         @return:            The Monte Carlo simulation data.
         @rtype:             list of floats
         """
@@ -1612,19 +1603,8 @@
         # Initialise the MC data structure.
         mc_data = []
 
-        # Alignment tensor data.
-        if data_id == 'A':
-            # Loop over the full tensors.
-            for i, tensor in self._tensor_loop(red=False):
-                # Append the data.
-                mc_data.append(tensor.Axx)
-                mc_data.append(tensor.Ayy)
-                mc_data.append(tensor.Axy)
-                mc_data.append(tensor.Axz)
-                mc_data.append(tensor.Ayz)
-
         # The RDC data.
-        elif data_id[0] == 'rdc':
+        if data_id[0] == 'rdc':
             # Unpack the set.
             data_type, spin_id1, spin_id2, align_id = data_id
 
@@ -2007,7 +1987,7 @@
         """Return the alignment tensor error structure.
 
         @param data_id:     The data set as yielded by the base_data_loop() 
generator method.
-        @type data_id:      str or list of str
+        @type data_id:      list of str
         @return:            The array of tensor error values.
         @rtype:             list of float
         """
@@ -2015,19 +1995,8 @@
         # Initialise the MC data structure.
         mc_errors = []
 
-        # Alignment tensor data.
-        if data_id == 'A':
-            # Loop over the full tensors.
-            for i, tensor in self._tensor_loop(red=False):
-                # Append the errors.
-                mc_errors.append(tensor.Axx_err)
-                mc_errors.append(tensor.Ayy_err)
-                mc_errors.append(tensor.Axy_err)
-                mc_errors.append(tensor.Axz_err)
-                mc_errors.append(tensor.Ayz_err)
-
         # The RDC data.
-        elif data_id[0] == 'rdc':
+        if data_id[0] == 'rdc':
             # Unpack the set.
             data_type, spin_id1, spin_id2, align_id = data_id
 
@@ -2195,29 +2164,13 @@
         """Pack the Monte Carlo simulation data.
 
         @param data_id:     The data set as yielded by the base_data_loop() 
generator method.
-        @type data_id:      str or list of str
+        @type data_id:      list of str
         @param sim_data:    The Monte Carlo simulation data.
         @type sim_data:     list of float
         """
 
-        # Alignment tensor data.
-        if data_id == 'A':
-            # Loop over the full tensors.
-            for i, tensor in self._tensor_loop(red=False):
-                # Set the simulation number.
-                tensor.set_sim_num(cdp.sim_number)
-
-                # Loop over the simulations.
-                for j in range(cdp.sim_number):
-                    # Set the full tensor simulation data.
-                    tensor.set(param='Axx', value=sim_data[5*i + 0][j], 
category='sim', sim_index=j)
-                    tensor.set(param='Ayy', value=sim_data[5*i + 1][j], 
category='sim', sim_index=j)
-                    tensor.set(param='Axy', value=sim_data[5*i + 2][j], 
category='sim', sim_index=j)
-                    tensor.set(param='Axz', value=sim_data[5*i + 3][j], 
category='sim', sim_index=j)
-                    tensor.set(param='Ayz', value=sim_data[5*i + 4][j], 
category='sim', sim_index=j)
-
         # The RDC data.
-        elif data_id[0] == 'rdc':
+        if data_id[0] == 'rdc':
             # Unpack the set.
             data_type, spin_id1, spin_id2, align_id = data_id
 




Related Messages


Powered by MHonArc, Updated Wed Oct 17 15:40:02 2012