Author: bugman Date: Thu Jan 10 16:10:02 2013 New Revision: 18191 URL: http://svn.gna.org/viewcvs/relax?rev=18191&view=rev Log: Merged revisions 18188-18189 via svnmerge from svn+ssh://bugman@xxxxxxxxxxx/svn/relax/trunk ........ r18188 | bugman | 2013-01-10 15:15:55 +0100 (Thu, 10 Jan 2013) | 5 lines Spun out the maths_fns.rotation_matrix.random_rot_axis() function into its own module. The function is now called maths_fns.vectors.random_unit_vector(). ........ r18189 | bugman | 2013-01-10 15:43:20 +0100 (Thu, 10 Jan 2013) | 5 lines Added a second data pipe with data to the 'align_tensor_mc.bz2' saved state to catch a bug. This bug was recently introduced. ........ Added: branches/frame_order_testing/maths_fns/vectors.py - copied unchanged from r18189, trunk/maths_fns/vectors.py Modified: branches/frame_order_testing/ (props changed) branches/frame_order_testing/maths_fns/__init__.py branches/frame_order_testing/maths_fns/rotation_matrix.py branches/frame_order_testing/test_suite/shared_data/saved_states/align_tensor_mc.bz2 Propchange: branches/frame_order_testing/ ------------------------------------------------------------------------------ --- svnmerge-integrated (original) +++ svnmerge-integrated Thu Jan 10 16:10:02 2013 @@ -1,1 +1,1 @@ -/trunk:1-18186 +/trunk:1-18189 Modified: branches/frame_order_testing/maths_fns/__init__.py URL: http://svn.gna.org/viewcvs/relax/branches/frame_order_testing/maths_fns/__init__.py?rev=18191&r1=18190&r2=18191&view=diff ============================================================================== --- branches/frame_order_testing/maths_fns/__init__.py (original) +++ branches/frame_order_testing/maths_fns/__init__.py Thu Jan 10 16:10:02 2013 @@ -1,6 +1,6 @@ ############################################################################### # # -# Copyright (C) 2003-2005, 2008-2010 Edward d'Auvergne # +# Copyright (C) 2003-2013 Edward d'Auvergne # # # # This file is part of the program relax (http://www.nmr-relax.com). # # # @@ -45,4 +45,5 @@ 'ri_prime', 'ri', 'rotation_matrix', - 'weights' ] + 'weights', + 'vectors' ] Modified: branches/frame_order_testing/maths_fns/rotation_matrix.py URL: http://svn.gna.org/viewcvs/relax/branches/frame_order_testing/maths_fns/rotation_matrix.py?rev=18191&r1=18190&r2=18191&view=diff ============================================================================== --- branches/frame_order_testing/maths_fns/rotation_matrix.py (original) +++ branches/frame_order_testing/maths_fns/rotation_matrix.py Thu Jan 10 16:10:02 2013 @@ -1,6 +1,6 @@ ############################################################################### # # -# Copyright (C) 2004-2005, 2008-2010 Edward d'Auvergne # +# Copyright (C) 2004-2013 Edward d'Auvergne # # # # This file is part of the program relax (http://www.nmr-relax.com). # # # @@ -21,13 +21,14 @@ # Python module imports. from copy import deepcopy -from math import acos, asin, atan2, cos, pi, sin, sqrt -from numpy import array, cross, dot, float64, hypot, sign, transpose, zeros +from math import acos, atan2, cos, pi, sin, sqrt +from numpy import array, cross, dot, float64, hypot, transpose, zeros from numpy.linalg import norm -from random import gauss, uniform +from random import gauss # relax module imports. import generic_fns +from maths_fns.vectors import random_unit_vector # Global variables. @@ -1505,7 +1506,7 @@ # Random rotation axis. rot_axis = zeros(3, float64) - random_rot_axis(rot_axis) + random_unit_vector(rot_axis) # Generate the rotation matrix. axis_angle_to_R(rot_axis, angle, R) @@ -1887,29 +1888,6 @@ quat[3] = copysign(0.5*sqrt(1 - R[0, 0] - R[1, 1] + R[2, 2]), quat[3]) -def random_rot_axis(axis): - """Generate a random rotation axis. - - Uniform point sampling on a unit sphere is used to generate a random axis orientation. - - @param axis: The 3D rotation axis. - @type axis: numpy array, len 3 - """ - - # Random azimuthal angle. - u = uniform(0, 1) - theta = 2*pi*u - - # Random polar angle. - v = uniform(0, 1) - phi = acos(2.0*v - 1) - - # Random rotation axis. - axis[0] = cos(theta) * sin(phi) - axis[1] = sin(theta) * sin(phi) - axis[2] = cos(phi) - - def reverse_euler_xyx(alpha, beta, gamma): """Convert the given forward rotation Euler angles into the equivalent reverse rotation Euler angles. Modified: branches/frame_order_testing/test_suite/shared_data/saved_states/align_tensor_mc.bz2 URL: http://svn.gna.org/viewcvs/relax/branches/frame_order_testing/test_suite/shared_data/saved_states/align_tensor_mc.bz2?rev=18191&r1=18190&r2=18191&view=diff ============================================================================== Binary files - no diff available.