Author: bugman Date: Thu Jun 18 10:41:27 2009 New Revision: 9077 URL: http://svn.gna.org/viewcvs/relax?rev=9077&view=rev Log: Renamed the frame_order package to frame_order_matrix_ops. This is to make way for the target function code. Added: branches/frame_order/maths_fns/frame_order_matrix_ops.py - copied unchanged from r9076, branches/frame_order/maths_fns/frame_order.py Removed: branches/frame_order/maths_fns/frame_order.py Removed: branches/frame_order/maths_fns/frame_order.py URL: http://svn.gna.org/viewcvs/relax/branches/frame_order/maths_fns/frame_order.py?rev=9076&view=auto ============================================================================== --- branches/frame_order/maths_fns/frame_order.py (original) +++ branches/frame_order/maths_fns/frame_order.py (removed) @@ -1,90 +1,0 @@ -############################################################################### -# # -# Copyright (C) 2009 Edward d'Auvergne # -# # -# This file is part of the program relax. # -# # -# relax is free software; you can redistribute it and/or modify # -# it under the terms of the GNU General Public License as published by # -# the Free Software Foundation; either version 2 of the License, or # -# (at your option) any later version. # -# # -# relax is distributed in the hope that it will be useful, # -# but WITHOUT ANY WARRANTY; without even the implied warranty of # -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -# GNU General Public License for more details. # -# # -# You should have received a copy of the GNU General Public License # -# along with relax; if not, write to the Free Software # -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# # -############################################################################### - -# Module docstring. -"""Module for the handling of Frame Order.""" - -# Python module imports. -from math import cos - - -def populate_1st_eigenframe_iso_cone(matrix, angle): - """Populate the 1st degree Frame Order matrix in the eigenframe for an isotropic cone. - - The cone axis is assumed to be parallel to the z-axis in the eigenframe. - - @param matrix: The Frame Order matrix, 1st degree. - @type matrix: numpy 3D, rank-2 array - @param angle: The cone angle. - @type angle: float - """ - - # Zeros. - for i in range(3): - for j in range(3): - matrix[i, j] = 0.0 - - # The c33 element. - matrix[2, 2] = (cos(angle) + 1.0) / 2.0 - - -def populate_2nd_eigenframe_iso_cone(matrix, angle): - """Populate the 2nd degree Frame Order matrix in the eigenframe for an isotropic cone. - - The cone axis is assumed to be parallel to the z-axis in the eigenframe. - - @param matrix: The Frame Order matrix, 2nd degree. - @type matrix: numpy 9D, rank-2 array - @param angle: The cone angle. - @type angle: float - """ - - # Zeros. - for i in range(9): - for j in range(9): - matrix[i, j] = 0.0 - - # Trigonometric terms. - cos_theta = cos(angle) - cos2_theta = cos_theta**2 - - # The c11^2, c22^2, c12^2, and c21^2 elements. - matrix[0, 0] = (4.0 + cos_theta + cos2_theta) / 12.0 - matrix[4, 4] = matrix[0, 0] - matrix[1, 1] = matrix[0, 0] - matrix[3, 3] = matrix[0, 0] - - # The c33^2 element. - matrix[8, 8] = (1.0 + cos_theta + cos2_theta) / 3.0 - - # The c13^2, c31^2, c23^2, c32^2 elements. - matrix[2, 2] = (2.0 + cos_theta)*(1.0 - cos_theta) / 6.0 - matrix[6, 6] = matrix[2, 2] - matrix[5, 5] = matrix[2, 2] - matrix[7, 7] = matrix[2, 2] - - # The c11.c22 and c12.c21 elements. - matrix[0, 4] = matrix[4, 0] = (cos_theta + 1.0) / 4.0 - matrix[1, 3] = matrix[3, 1] = -(cos_theta + 1.0) / 4.0 - - -