Author: bugman Date: Mon Nov 10 15:04:26 2014 New Revision: 26481 URL: http://svn.gna.org/viewcvs/relax?rev=26481&view=rev Log: Eliminated the lib.frame_order.iso_cone.populate_*() functions.
The populate_1st_eigenframe_iso_cone() function was unused and incorrect, so it was deleted. The contents of the populate_2nd_eigenframe_iso_cone() function have been shifted compile_2nd_matrix_iso_cone() as a separate function is unnecessary. This now matches all the other lib.frame_order modules. Modified: branches/frame_order_cleanup/lib/frame_order/iso_cone.py Modified: branches/frame_order_cleanup/lib/frame_order/iso_cone.py URL: http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/lib/frame_order/iso_cone.py?rev=26481&r1=26480&r2=26481&view=diff ============================================================================== --- branches/frame_order_cleanup/lib/frame_order/iso_cone.py (original) +++ branches/frame_order_cleanup/lib/frame_order/iso_cone.py Mon Nov 10 15:04:26 2014 @@ -78,8 +78,40 @@ @type sigma_max: float """ - # Populate the Frame Order matrix in the eigenframe. - populate_2nd_eigenframe_iso_cone(matrix, cone_theta, sigma_max) + # Zeros. + matrix[:] = 0.0 + + # Repetitive trig calculations. + sinc_smax = sinc(sigma_max/pi) + sinc_2smax = sinc(2.0*sigma_max/pi) + cos_tmax = cos(cone_theta) + cos_tmax2 = cos_tmax**2 + + # Larger factors. + fact_sinc_2smax = sinc_2smax*(cos_tmax2 + 4.0*cos_tmax + 7.0) / 24.0 + fact_cos_tmax2 = (cos_tmax2 + cos_tmax + 4.0) / 12.0 + fact_cos_tmax = (cos_tmax + 1.0) / 4.0 + + # Diagonal. + matrix[0, 0] = fact_sinc_2smax + fact_cos_tmax2 + matrix[1, 1] = fact_sinc_2smax + fact_cos_tmax + matrix[2, 2] = sinc_smax * (2.0*cos_tmax2 + 5.0*cos_tmax + 5.0) / 12.0 + matrix[3, 3] = matrix[1, 1] + matrix[4, 4] = matrix[0, 0] + matrix[5, 5] = matrix[2, 2] + matrix[6, 6] = matrix[2, 2] + matrix[7, 7] = matrix[2, 2] + matrix[8, 8] = (cos_tmax2 + cos_tmax + 1.0) / 3.0 + + # Off diagonal set 1. + matrix[0, 4] = matrix[4, 0] = -fact_sinc_2smax + fact_cos_tmax2 + matrix[0, 8] = matrix[8, 0] = -(cos_tmax2 + cos_tmax - 2.0) / 6.0 + matrix[4, 8] = matrix[8, 4] = matrix[0, 8] + + # Off diagonal set 2. + matrix[1, 3] = matrix[3, 1] = fact_sinc_2smax - fact_cos_tmax + matrix[2, 6] = matrix[6, 2] = sinc_smax * (cos_tmax2 + cos_tmax - 2.0) / 6.0 + matrix[5, 7] = matrix[7, 5] = matrix[2, 6] # Rotate and return the frame order matrix. return rotate_daeg(matrix, Rx2_eigen) @@ -204,71 +236,3 @@ # Return the value. return c * result[0] / SA - - -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. - matrix[:] = 0.0 - - # The c33 element. - matrix[2, 2] = (cos(angle) + 1.0) / 2.0 - - -def populate_2nd_eigenframe_iso_cone(matrix, tmax, smax): - """Populate the 2nd degree Frame Order matrix in the eigenframe for the 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 tmax: The cone opening angle. - @type tmax: float - @param smax: The maximum torsion angle. - @type smax: float - """ - - # Zeros. - matrix[:] = 0.0 - - # Repetitive trig calculations. - sinc_smax = sinc(smax/pi) - sinc_2smax = sinc(2.0*smax/pi) - cos_tmax = cos(tmax) - cos_tmax2 = cos_tmax**2 - - # Larger factors. - fact_sinc_2smax = sinc_2smax*(cos_tmax2 + 4.0*cos_tmax + 7.0) / 24.0 - fact_cos_tmax2 = (cos_tmax2 + cos_tmax + 4.0) / 12.0 - fact_cos_tmax = (cos_tmax + 1.0) / 4.0 - - # Diagonal. - matrix[0, 0] = fact_sinc_2smax + fact_cos_tmax2 - matrix[1, 1] = fact_sinc_2smax + fact_cos_tmax - matrix[2, 2] = sinc_smax * (2.0*cos_tmax2 + 5.0*cos_tmax + 5.0) / 12.0 - matrix[3, 3] = matrix[1, 1] - matrix[4, 4] = matrix[0, 0] - matrix[5, 5] = matrix[2, 2] - matrix[6, 6] = matrix[2, 2] - matrix[7, 7] = matrix[2, 2] - matrix[8, 8] = (cos_tmax2 + cos_tmax + 1.0) / 3.0 - - # Off diagonal set 1. - matrix[0, 4] = matrix[4, 0] = -fact_sinc_2smax + fact_cos_tmax2 - matrix[0, 8] = matrix[8, 0] = -(cos_tmax2 + cos_tmax - 2.0) / 6.0 - matrix[4, 8] = matrix[8, 4] = matrix[0, 8] - - # Off diagonal set 2. - matrix[1, 3] = matrix[3, 1] = fact_sinc_2smax - fact_cos_tmax - matrix[2, 6] = matrix[6, 2] = sinc_smax * (cos_tmax2 + cos_tmax - 2.0) / 6.0 - matrix[5, 7] = matrix[7, 5] = matrix[2, 6] _______________________________________________ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org 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