Author: bugman Date: Wed Jun 25 09:47:33 2014 New Revision: 24311 URL: http://svn.gna.org/viewcvs/relax?rev=24311&view=rev Log: Created a frame order optimisation script for the CaM double rotor test suite data. This is the script used for testing the implementation, it will not be used in the test suite. Added: branches/frame_order_cleanup/test_suite/shared_data/frame_order/cam/double_rotor/frame_order.py - copied, changed from r23810, branches/frame_order_cleanup/test_suite/shared_data/frame_order/cam/pseudo_ellipse/frame_order.py Copied: branches/frame_order_cleanup/test_suite/shared_data/frame_order/cam/double_rotor/frame_order.py (from r23810, branches/frame_order_cleanup/test_suite/shared_data/frame_order/cam/pseudo_ellipse/frame_order.py) URL: http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/test_suite/shared_data/frame_order/cam/double_rotor/frame_order.py?p2=branches/frame_order_cleanup/test_suite/shared_data/frame_order/cam/double_rotor/frame_order.py&p1=branches/frame_order_cleanup/test_suite/shared_data/frame_order/cam/pseudo_ellipse/frame_order.py&r1=23810&r2=24311&rev=24311&view=diff ============================================================================== --- branches/frame_order_cleanup/test_suite/shared_data/frame_order/cam/pseudo_ellipse/frame_order.py (original) +++ branches/frame_order_cleanup/test_suite/shared_data/frame_order/cam/double_rotor/frame_order.py Wed Jun 25 09:47:33 2014 @@ -1,18 +1,45 @@ # Script for optimising the pseudo-ellipse frame order test model of CaM. # Python module imports. -from numpy import array +from numpy import array, float64, transpose +from numpy.linalg import norm + +# relax module imports. +from lib.geometry.rotations import R_to_euler_zyz + + +def eigen_system(): + """Recreate the eigensystem parameters.""" + + # The centre of masses of each domain (from the system_create.log file). + N_COM = array([41.739, 6.03, -0.764], float64) + C_COM = array([26.837, -12.379, 28.342], float64) + + # The Z-axis as the inter CoM vector. + z_axis = N_COM - C_COM + disp = norm(z_axis) + z_axis /= disp + + # The eigenframe (partly from the system_create.log file). + eigensystem = transpose(array([ + [-0.487095774865268, -0.60362450312215, -0.63116968030708 ], + [ -7.778375610280605e-01, 6.284649244351433e-01, -7.532653237683726e-04], + z_axis + ], float64)) + + # Convert to Euler angles. + a, b, g = R_to_euler_zyz(eigensystem) + + # Return the parameters. + return a, b, g, disp # The real parameter values. AVE_POS_X, AVE_POS_Y, AVE_POS_Z = [ -20.859750185691549, -2.450606987447843, -2.191854570352916] AVE_POS_ALPHA, AVE_POS_BETA, AVE_POS_GAMMA = [5.623468683852550, 0.435439748282942, 5.081265879629926] -EIGEN_ALPHA = 3.14159265358979311600 -EIGEN_BETA = 0.96007997859534310869 -EIGEN_GAMMA = 4.03227550621962294031 -CONE_THETA_X = 30.0 * 2.0 * pi / 360.0 # 0.52359877559829882 -CONE_THETA_Y = 50.0 * 2.0 * pi / 360.0 # 0.87266462599716477 -CONE_SIGMA_MAX = 60.0 * 2.0 * pi / 360.0 # 1.0471975511965976 +EIGEN_ALPHA, EIGEN_BETA, EIGEN_GAMMA, PIVOT_DISP = eigen_system() +CONE_SIGMA_MAX = 10.5 * 2.0 * pi / 360.0 # 0.1832595714594046 +CONE_SIGMA_MAX_2 = 11.5 * 2.0 * pi / 360.0 # 0.20071286397934787 # Create the data pipe. pipe.create(pipe_name='frame order', pipe_type='frame order') @@ -36,7 +63,7 @@ ln = ['dy', 'tb', 'tm', 'er'] for i in range(len(ln)): # Load the RDCs. - rdc.read(align_id=ln[i], file='rdc_%s.txt'%ln[i], spin_id1_col=1, spin_id2_col=2, data_col=3, error_col=4) + #rdc.read(align_id=ln[i], file='rdc_%s.txt'%ln[i], spin_id1_col=1, spin_id2_col=2, data_col=3, error_col=4) # The PCS. pcs.read(align_id=ln[i], file='pcs_%s.txt'%ln[i], mol_name_col=1, res_num_col=2, spin_name_col=5, data_col=6, error_col=7) @@ -68,13 +95,13 @@ align_tensor.reduction(full_tensor=full[i], red_tensor=red[i]) # Select the model. -frame_order.select_model('pseudo-ellipse') +frame_order.select_model('double rotor') # Set the reference domain. frame_order.ref_domain('N') # Set the initial pivot point. -pivot = array([ 37.254, 0.5, 16.7465]) +pivot = array([ 26.837, -12.379, 28.342]) frame_order.pivot(pivot, fix=True) # Set the paramagnetic centre. @@ -91,9 +118,9 @@ value.set(param='eigen_alpha', val=EIGEN_ALPHA) value.set(param='eigen_beta', val=EIGEN_BETA) value.set(param='eigen_gamma', val=EIGEN_GAMMA) -value.set(param='cone_theta_x', val=CONE_THETA_X) -value.set(param='cone_theta_y', val=CONE_THETA_Y) +value.set(param='pivot_disp', val=PIVOT_DISP) value.set(param='cone_sigma_max', val=CONE_SIGMA_MAX) +value.set(param='cone_sigma_max_2', val=CONE_SIGMA_MAX_2) calc() # Create the PDB representation of the true state. @@ -101,7 +128,7 @@ # Grid search (low quality for speed). frame_order.num_int_pts(num=100) -grid_search(inc=[None, None, None, None, None, None, 7, 7, 7, 7, 7, 7]) +grid_search(inc=[None, None, None, None, None, None, None, 7, 7, 7, 7, 7]) # Iterative optimisation with increasing precision. num_int_pts = [100, 1000, 10000, 50000]