Author: bugman
Date: Wed Sep 10 13:41:33 2014
New Revision: 25730
URL: http://svn.gna.org/viewcvs/relax?rev=25730&view=rev
Log:
Implemented the new frame_order.permute_axes backend.
The 3 starting conditions x<y<z, x<z<y, and z<x<y and the two permutations 'A'
and 'B' (for each of
these which do not include the starting permutation) are now supported. For
these 6 combinations,
the axis and order parameter permutation and the z-axis inversion are selected
and applied to the
current system.
Modified:
branches/frame_order_cleanup/specific_analyses/frame_order/uf.py
Modified: branches/frame_order_cleanup/specific_analyses/frame_order/uf.py
URL:
http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/specific_analyses/frame_order/uf.py?rev=25730&r1=25729&r2=25730&view=diff
==============================================================================
--- branches/frame_order_cleanup/specific_analyses/frame_order/uf.py
(original)
+++ branches/frame_order_cleanup/specific_analyses/frame_order/uf.py Wed Sep
10 13:41:33 2014
@@ -29,7 +29,7 @@
# relax module imports.
from lib.arg_check import is_float_array
from lib.check_types import is_float
-from lib.errors import RelaxError
+from lib.errors import RelaxError, RelaxFault
from lib.geometry.rotations import euler_to_R_zyz, R_to_euler_zyz
from lib.warnings import RelaxWarning
from pipe_control import pipes
@@ -121,6 +121,7 @@
if cdp.model == MODEL_PSEUDO_ELLIPSE:
cone_sigma_max = cdp.cone_sigma_max
angles = array([cdp.cone_theta_y, cdp.cone_theta_x, cone_sigma_max],
float64)
+ y, x, z = angles
# Generate the eigenframe of the motion.
frame = zeros((3, 3), float64)
@@ -128,19 +129,61 @@
# Start printout.
print("\nOriginal parameters:")
+ print("%-20s %20.10f" % ("cone_theta_x", cdp.cone_theta_x))
+ print("%-20s %20.10f" % ("cone_theta_y", cdp.cone_theta_y))
+ print("%-20s %20.10f" % ("cone_sigma_max", cone_sigma_max))
print("%-20s %20.10f" % ("eigen_alpha", cdp.eigen_alpha))
print("%-20s %20.10f" % ("eigen_beta", cdp.eigen_beta))
print("%-20s %20.10f" % ("eigen_gamma", cdp.eigen_gamma))
print("%-20s\n%s" % ("eigenframe", frame))
- print("%-20s %20.10f" % ("cone_theta_x", cdp.cone_theta_x))
- print("%-20s %20.10f" % ("cone_theta_y", cdp.cone_theta_y))
- print("%-20s %20.10f" % ("cone_sigma_max", cone_sigma_max))
-
- # The permutation with the condition that cone_theta_x <= cone_theta_y.
- if angles[1] <= angles[2]:
- perm = [2, 0, 1]
+ print("\nPermutation '%s':" % permutation)
+
+ # The starting condition x <= y <= z.
+ if x <= y and y <= z:
+ # Printout.
+ print("%-20s %-20s" % ("Starting condition", "x <= y <= z"))
+
+ # The permutation and axis inversion.
+ if permutation == 'A':
+ perm = [0, 2, 1]
+ z_factor = -1.0
+ else:
+ perm = [2, 0, 1]
+ z_factor = 1.0
+
+ # The starting condition x <= z <= y.
+ elif x <= z and z <= y:
+ # Printout.
+ print("%-20s %-20s" % ("Starting condition", "x <= z <= y"))
+
+ # The permutation and axis inversion.
+ if permutation == 'A':
+ perm = [0, 2, 1]
+ z_factor = -1.0
+ else:
+ perm = [1, 2, 0]
+ z_factor = -1.0
+
+ # The starting condition z <= x <= y.
+ elif z <= x and x <= y:
+ # Printout.
+ print("%-20s %-20s" % ("Starting condition", "z <= x <= y"))
+
+ # The permutation and axis inversion.
+ if permutation == 'A':
+ perm = [1, 2, 0]
+ z_factor = 1.0
+ else:
+ perm = [2, 1, 0]
+ z_factor = -1.0
+
+ # Cannot be here.
else:
- perm = [1, 2, 0]
+ raise RelaxFault
+
+ # Printout.
+ print("%-20s %-20s" % ("permutation", perm))
+ print("%-20s %-20s" % ("z-axis inversion", z_factor))
# Permute the angles.
cdp.cone_theta_y = angles[perm[0]]
@@ -148,22 +191,21 @@
if cdp.model == MODEL_PSEUDO_ELLIPSE:
cdp.cone_sigma_max = angles[perm[2]]
- # Permute the axes.
- frame_new = transpose(array([frame[:, perm[0]], frame[:, perm[1]],
frame[:, perm[2]]], float64))
+ # Permute the axes and invert the z-axis as necessary.
+ frame_new = transpose(array([frame[:, perm[0]], frame[:, perm[1]],
z_factor*frame[:, perm[2]]], float64))
# Convert the permuted frame to Euler angles and store them.
cdp.eigen_alpha, cdp.eigen_beta, cdp.eigen_gamma =
R_to_euler_zyz(frame_new)
# End printout.
print("\nPermuted parameters:")
- print("%-20s %20s" % ("permutation", perm))
+ print("%-20s %20.10f" % ("cone_theta_x", cdp.cone_theta_x))
+ print("%-20s %20.10f" % ("cone_theta_y", cdp.cone_theta_y))
+ print("%-20s %20.10f" % ("cone_sigma_max", cdp.cone_sigma_max))
print("%-20s %20.10f" % ("eigen_alpha", cdp.eigen_alpha))
print("%-20s %20.10f" % ("eigen_beta", cdp.eigen_beta))
print("%-20s %20.10f" % ("eigen_gamma", cdp.eigen_gamma))
print("%-20s\n%s" % ("eigenframe", frame_new))
- print("%-20s %20.10f" % ("cone_theta_x", cdp.cone_theta_x))
- print("%-20s %20.10f" % ("cone_theta_y", cdp.cone_theta_y))
- print("%-20s %20.10f" % ("cone_sigma_max", cdp.cone_sigma_max))
def pivot(pivot=None, order=1, fix=False):
_______________________________________________
relax (http://www.nmr-relax.com)
This is the relax-commits mailing list
[email protected]
To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-commits