Author: bugman Date: Tue Jun 23 11:14:13 2009 New Revision: 9128 URL: http://svn.gna.org/viewcvs/relax?rev=9128&view=rev Log: Elimination of an Euler angle from the isotropic cone model. Only the cone axis theta and phi angles are now optimised. Modified: branches/frame_order/maths_fns/frame_order_models.py branches/frame_order/specific_fns/frame_order.py Modified: branches/frame_order/maths_fns/frame_order_models.py URL: http://svn.gna.org/viewcvs/relax/branches/frame_order/maths_fns/frame_order_models.py?rev=9128&r1=9127&r2=9128&view=diff ============================================================================== --- branches/frame_order/maths_fns/frame_order_models.py (original) +++ branches/frame_order/maths_fns/frame_order_models.py Tue Jun 23 11:14:13 2009 @@ -152,12 +152,11 @@ def func_iso_cone(self, params): """Target function for isotropic cone model optimisation using the alignment tensors. - This function optimises against alignment tensors. The Frame Order eigenframe via the - alpha, beta, and gamma Euler angles, and the cone angle theta are the 4 parameters optimised - in this model. - - @param params: The vector of parameter values {alpha, beta, gamma, theta} where the first - three are the Euler angles for the Frame Order eigenframe and theta is the + This function optimises against alignment tensors. The cone axis spherical angles theta and + phi and the cone angle theta are the 3 parameters optimised in this model. + + @param params: The vector of parameter values {theta, phi, theta_cone} where the first two + are the polar and azimuthal angles of the cone axis theta_cone is the isotropic cone angle. @type params: list of float @return: The chi-squared or SSE value. @@ -165,10 +164,10 @@ """ # Break up the parameters. - alpha, beta, gamma, theta = params + theta, phi, theta_cone = params # Generate the 2nd degree Frame Order super matrix. - self.frame_order_2nd = compile_2nd_matrix_iso_cone(self.frame_order_2nd, self.rot, alpha, beta, gamma, theta) + self.frame_order_2nd = compile_2nd_matrix_iso_cone(self.frame_order_2nd, self.rot, self.z_axis, theta, phi, theta_cone) # Back calculate the reduced tensors. for i in range(self.num_tensors): @@ -182,11 +181,11 @@ """Target function for isotropic cone model optimisation using the Frame Order matrix. This function optimises by directly matching the elements of the 2nd degree Frame Order - super matrix. The Frame Order eigenframe via the alpha, beta, and gamma Euler angles, and - the cone angle theta are the 4 parameters optimised in this model. - - @param params: The vector of parameter values {alpha, beta, gamma, theta} where the first - three are the Euler angles for the Frame Order eigenframe and theta is the + super matrix. The cone axis spherical angles theta and phi and the cone angle theta are the + 3 parameters optimised in this model. + + @param params: The vector of parameter values {theta, phi, theta_cone} where the first two + are the polar and azimuthal angles of the cone axis theta_cone is the isotropic cone angle. @type params: list of float @return: The chi-squared or SSE value. @@ -194,10 +193,10 @@ """ # Break up the parameters. - alpha, beta, gamma, theta = params + theta, phi, theta_cone = params # Generate the 2nd degree Frame Order super matrix. - self.frame_order_2nd = compile_2nd_matrix_iso_cone(self.frame_order_2nd, self.rot, alpha, beta, gamma, theta) + self.frame_order_2nd = compile_2nd_matrix_iso_cone(self.frame_order_2nd, self.rot, self.z_axis, theta, phi, theta_cone) # Make the Frame Order matrix contiguous. self.frame_order_2nd = self.frame_order_2nd.copy() Modified: branches/frame_order/specific_fns/frame_order.py URL: http://svn.gna.org/viewcvs/relax/branches/frame_order/specific_fns/frame_order.py?rev=9128&r1=9127&r2=9128&view=diff ============================================================================== --- branches/frame_order/specific_fns/frame_order.py (original) +++ branches/frame_order/specific_fns/frame_order.py Tue Jun 23 11:14:13 2009 @@ -105,20 +105,17 @@ if cdp.model == 'iso cone': # Set up the parameter arrays. if not len(cdp.params): - cdp.params.append('alpha') - cdp.params.append('beta') - cdp.params.append('gamma') - cdp.params.append('theta') - - # Initialise the Euler angle and cone angle values. - if not hasattr(cdp, 'alpha'): - cdp.alpha = 0.0 - if not hasattr(cdp, 'beta'): - cdp.beta = 0.0 - if not hasattr(cdp, 'gamma'): - cdp.gamma = 0.0 - if not hasattr(cdp, 'theta'): - cdp.theta = 0.0 + cdp.params.append('theta_axis') + cdp.params.append('phi_axis') + cdp.params.append('theta_cone') + + # Initialise the cone axis angles and cone angle values. + if not hasattr(cdp, 'theta_axis'): + cdp.theta_axis = 0.0 + if not hasattr(cdp, 'phi_axis'): + cdp.phi_axis = 0.0 + if not hasattr(cdp, 'theta_cone'): + cdp.theta_cone = 0.0 def __unpack_opt_results(self, results, sim_index=None): @@ -148,21 +145,20 @@ # Isotropic cone model. if cdp.model == 'iso cone': # Disassemble the parameter vector. - alpha, beta, gamma, theta = param_vector + theta_axis, phi_axis, theta_cone = param_vector # Wrap the cone angle to be between 0 and pi. - if theta < 0.0: - theta = -theta - if theta > pi: - theta = 2.0*pi - theta + if theta_cone < 0.0: + theta_cone = -theta_cone + if theta_cone > pi: + theta_cone = 2.0*pi - theta_cone # Monte Carlo simulation data structures. if sim_index != None: # Model parameters. - cdp.alpha_sim[sim_index] = alpha - cdp.beta_sim[sim_index] = beta - cdp.gamma_sim[sim_index] = gamma - cdp.theta_sim[sim_index] = theta + cdp.theta_axis_sim[sim_index] = theta_axis + cdp.phi_axis_sim[sim_index] = phi_axis + cdp.theta_cone_sim[sim_index] = theta_cone # Optimisation info. cdp.chi2_sim[sim_index] = func @@ -175,10 +171,9 @@ # Normal data structures. else: # Model parameters. - cdp.alpha = alpha - cdp.beta = beta - cdp.gamma = gamma - cdp.theta = theta + cdp.theta_axis = theta_axis + cdp.phi_axis = phi_axis + cdp.theta_cone = theta_cone # Optimisation info. cdp.chi2 = func @@ -232,14 +227,12 @@ # Set the grid search options. for i in xrange(n): - # Euler angles. - if cdp.params[i] in ['alpha', 'gamma']: - grid_ops.append([inc[i], 0.0, 2*pi]) - if cdp.params[i] == 'beta': + # Cone axis angles and cone angle. + if cdp.params[i] == 'phi_axis': grid_ops.append([inc[i], 0.0, pi]) - - # The cone angle. - if cdp.params[i] == 'theta': + if cdp.params[i] == 'theta_axis': + grid_ops.append([inc[i], 0.0, pi]) + if cdp.params[i] == 'theta_cone': grid_ops.append([inc[i], 0.0, pi]) # Lower bound (if supplied). @@ -287,8 +280,8 @@ # Isotropic cone model. if cdp.model == 'iso cone': - # The initial parameter vector (the Euler angles and the cone angle). - param_vector = array([cdp.alpha, cdp.beta, cdp.gamma, cdp.theta], float64) + # The initial parameter vector (the cone axis angles and the cone angle). + param_vector = array([cdp.theta_axis, cdp.phi_axis, cdp.theta_cone], float64) # Get the data structures for optimisation using the tensors as base data sets. full_tensors, red_tensors, red_tensor_err = self.__minimise_setup_tensors()