Author: bugman Date: Sun Nov 2 22:14:50 2014 New Revision: 26416 URL: http://svn.gna.org/viewcvs/relax?rev=26416&view=rev Log: Implemented the compile_1st_matrix_iso_cone_torsionless() function. This is for the lib.frame_order.iso_cone_torsionless module. The function will calculate the 1st degree in-frame frame order matrix for the torsionless isotropic cone model. Modified: branches/frame_order_cleanup/lib/frame_order/iso_cone_torsionless.py Modified: branches/frame_order_cleanup/lib/frame_order/iso_cone_torsionless.py URL: http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/lib/frame_order/iso_cone_torsionless.py?rev=26416&r1=26415&r2=26416&view=diff ============================================================================== --- branches/frame_order_cleanup/lib/frame_order/iso_cone_torsionless.py (original) +++ branches/frame_order_cleanup/lib/frame_order/iso_cone_torsionless.py Sun Nov 2 22:14:50 2014 @@ -32,6 +32,32 @@ # relax module imports. from lib.frame_order.matrix_ops import pcs_pivot_motion_torsionless_qr_int, pcs_pivot_motion_torsionless_quad_int, rotate_daeg + + +def compile_1st_matrix_iso_cone_torsionless(matrix, R_eigen, cone_theta): + """Generate the 1st degree Frame Order matrix for the torsionless isotropic cone. + + @param matrix: The Frame Order matrix, 1st degree to be populated. + @type matrix: numpy 3D, rank-2 array + @param R_eigen: The eigenframe rotation matrix. + @type R_eigen: numpy 3D, rank-2 array + @param cone_theta: The cone opening angle. + @type cone_theta: float + """ + + # Zeros. + matrix[:] = 0.0 + + # Pre-calculate trig values. + cos_theta = cos(cone_theta) + + # Diagonal values. + matrix[0, 0] = cos_theta + 3.0 + matrix[1, 1] = matrix[0, 0] + matrix[2, 2] = 2.0*cos_theta + 2.0 + + # Rotate and return the frame order matrix. + return 0.25 * rotate_daeg(matrix, R_eigen) def compile_2nd_matrix_iso_cone_torsionless(matrix, Rx2_eigen, cone_theta):