Author: bugman Date: Wed Sep 17 17:11:41 2014 New Revision: 25879 URL: http://svn.gna.org/viewcvs/relax?rev=25879&view=rev Log: Fix for the rigid frame order model for the recent frame_order.sobol_setup user function changes. For this model, the number of Sobol' points normally is does not exist. This is now correctly handled. Modified: branches/frame_order_cleanup/specific_analyses/frame_order/api.py branches/frame_order_cleanup/specific_analyses/frame_order/optimisation.py Modified: branches/frame_order_cleanup/specific_analyses/frame_order/api.py URL: http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/specific_analyses/frame_order/api.py?rev=25879&r1=25878&r2=25879&view=diff ============================================================================== --- branches/frame_order_cleanup/specific_analyses/frame_order/api.py (original) +++ branches/frame_order_cleanup/specific_analyses/frame_order/api.py Wed Sep 17 17:11:41 2014 @@ -129,8 +129,14 @@ # Set up the data structures for the target function. param_vector, full_tensors, full_in_ref_frame, rdcs, rdc_err, rdc_weight, rdc_vect, rdc_const, pcs, pcs_err, pcs_weight, atomic_pos, temp, frq, paramag_centre, com, ave_pos_pivot, pivot, pivot_opt = target_fn_data_setup(sim_index=sim_index, verbosity=verbosity, unset_fail=True) + # The Sobol' integration information. + sobol_max_points, sobol_oversample = None, None + if hasattr(cdp, 'sobol_max_points'): + sobol_max_points = cdp.sobol_max_points + sobol_oversample = cdp.sobol_oversample + # Set up the optimisation target function class. - target_fn = frame_order.Frame_order(model=cdp.model, init_params=param_vector, full_tensors=full_tensors, full_in_ref_frame=full_in_ref_frame, rdcs=rdcs, rdc_errors=rdc_err, rdc_weights=rdc_weight, rdc_vect=rdc_vect, dip_const=rdc_const, pcs=pcs, pcs_errors=pcs_err, pcs_weights=pcs_weight, atomic_pos=atomic_pos, temp=temp, frq=frq, paramag_centre=paramag_centre, scaling_matrix=scaling_matrix[0], com=com, ave_pos_pivot=ave_pos_pivot, pivot=pivot, pivot_opt=pivot_opt, sobol_max_points=cdp.sobol_max_points, sobol_oversample=cdp.sobol_oversample) + target_fn = frame_order.Frame_order(model=cdp.model, init_params=param_vector, full_tensors=full_tensors, full_in_ref_frame=full_in_ref_frame, rdcs=rdcs, rdc_errors=rdc_err, rdc_weights=rdc_weight, rdc_vect=rdc_vect, dip_const=rdc_const, pcs=pcs, pcs_errors=pcs_err, pcs_weights=pcs_weight, atomic_pos=atomic_pos, temp=temp, frq=frq, paramag_centre=paramag_centre, scaling_matrix=scaling_matrix[0], com=com, ave_pos_pivot=ave_pos_pivot, pivot=pivot, pivot_opt=pivot_opt, sobol_max_points=sobol_max_points, sobol_oversample=sobol_oversample) # Make a single function call. This will cause back calculation and the data will be stored in the class instance. chi2 = target_fn.func(param_vector) @@ -459,6 +465,12 @@ warn(RelaxWarning("The '%s' model parameters are not constrained, turning the linear constraint algorithm off." % cdp.model)) constraints = False + # The Sobol' integration information. + sobol_max_points, sobol_oversample = None, None + if hasattr(cdp, 'sobol_max_points'): + sobol_max_points = cdp.sobol_max_points + sobol_oversample = cdp.sobol_oversample + # Set up the data structures for the target function. param_vector, full_tensors, full_in_ref_frame, rdcs, rdc_err, rdc_weight, rdc_vect, rdc_const, pcs, pcs_err, pcs_weight, atomic_pos, temp, frq, paramag_centre, com, ave_pos_pivot, pivot, pivot_opt = target_fn_data_setup(sim_index=sim_index, verbosity=verbosity) @@ -481,7 +493,7 @@ memo = Frame_order_memo(sim_index=sim_index, scaling_matrix=scaling_matrix[0]) # Set up the command object to send to the slave and execute. - command = Frame_order_grid_command(points=subdivision, scaling_matrix=scaling_matrix[0], sim_index=sim_index, model=cdp.model, param_vector=param_vector, full_tensors=full_tensors, full_in_ref_frame=full_in_ref_frame, rdcs=rdcs, rdc_err=rdc_err, rdc_weight=rdc_weight, rdc_vect=rdc_vect, rdc_const=rdc_const, pcs=pcs, pcs_err=pcs_err, pcs_weight=pcs_weight, atomic_pos=atomic_pos, temp=temp, frq=frq, paramag_centre=paramag_centre, com=com, ave_pos_pivot=ave_pos_pivot, pivot=pivot, pivot_opt=pivot_opt, sobol_max_points=cdp.sobol_max_points, sobol_oversample=cdp.sobol_oversample, verbosity=verbosity) + command = Frame_order_grid_command(points=subdivision, scaling_matrix=scaling_matrix[0], sim_index=sim_index, model=cdp.model, param_vector=param_vector, full_tensors=full_tensors, full_in_ref_frame=full_in_ref_frame, rdcs=rdcs, rdc_err=rdc_err, rdc_weight=rdc_weight, rdc_vect=rdc_vect, rdc_const=rdc_const, pcs=pcs, pcs_err=pcs_err, pcs_weight=pcs_weight, atomic_pos=atomic_pos, temp=temp, frq=frq, paramag_centre=paramag_centre, com=com, ave_pos_pivot=ave_pos_pivot, pivot=pivot, pivot_opt=pivot_opt, sobol_max_points=sobol_max_points, sobol_oversample=sobol_oversample, verbosity=verbosity) # Add the slave command and memo to the processor queue. processor.add_to_queue(command, memo) @@ -564,6 +576,12 @@ # Set up the data structures for the target function. param_vector, full_tensors, full_in_ref_frame, rdcs, rdc_err, rdc_weight, rdc_vect, rdc_const, pcs, pcs_err, pcs_weight, atomic_pos, temp, frq, paramag_centre, com, ave_pos_pivot, pivot, pivot_opt = target_fn_data_setup(sim_index=sim_index, verbosity=verbosity, unset_fail=True) + # The Sobol' integration information. + sobol_max_points, sobol_oversample = None, None + if hasattr(cdp, 'sobol_max_points'): + sobol_max_points = cdp.sobol_max_points + sobol_oversample = cdp.sobol_oversample + # Get the Processor box singleton (it contains the Processor instance) and alias the Processor. processor_box = Processor_box() processor = processor_box.processor @@ -572,7 +590,7 @@ memo = Frame_order_memo(sim_index=sim_index, scaling_matrix=scaling_matrix[0]) # Set up the command object to send to the slave and execute. - command = Frame_order_minimise_command(min_algor=min_algor, min_options=min_options, func_tol=func_tol, grad_tol=grad_tol, max_iterations=max_iterations, scaling_matrix=scaling_matrix[0], constraints=constraints, sim_index=sim_index, model=cdp.model, param_vector=param_vector, full_tensors=full_tensors, full_in_ref_frame=full_in_ref_frame, rdcs=rdcs, rdc_err=rdc_err, rdc_weight=rdc_weight, rdc_vect=rdc_vect, rdc_const=rdc_const, pcs=pcs, pcs_err=pcs_err, pcs_weight=pcs_weight, atomic_pos=atomic_pos, temp=temp, frq=frq, paramag_centre=paramag_centre, com=com, ave_pos_pivot=ave_pos_pivot, pivot=pivot, pivot_opt=pivot_opt, sobol_max_points=cdp.sobol_max_points, sobol_oversample=cdp.sobol_oversample, verbosity=verbosity) + command = Frame_order_minimise_command(min_algor=min_algor, min_options=min_options, func_tol=func_tol, grad_tol=grad_tol, max_iterations=max_iterations, scaling_matrix=scaling_matrix[0], constraints=constraints, sim_index=sim_index, model=cdp.model, param_vector=param_vector, full_tensors=full_tensors, full_in_ref_frame=full_in_ref_frame, rdcs=rdcs, rdc_err=rdc_err, rdc_weight=rdc_weight, rdc_vect=rdc_vect, rdc_const=rdc_const, pcs=pcs, pcs_err=pcs_err, pcs_weight=pcs_weight, atomic_pos=atomic_pos, temp=temp, frq=frq, paramag_centre=paramag_centre, com=com, ave_pos_pivot=ave_pos_pivot, pivot=pivot, pivot_opt=pivot_opt, sobol_max_points=sobol_max_points, sobol_oversample=sobol_oversample, verbosity=verbosity) # Add the slave command and memo to the processor queue. processor.add_to_queue(command, memo) Modified: branches/frame_order_cleanup/specific_analyses/frame_order/optimisation.py URL: http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/specific_analyses/frame_order/optimisation.py?rev=25879&r1=25878&r2=25879&view=diff ============================================================================== --- branches/frame_order_cleanup/specific_analyses/frame_order/optimisation.py (original) +++ branches/frame_order_cleanup/specific_analyses/frame_order/optimisation.py Wed Sep 17 17:11:41 2014 @@ -83,8 +83,14 @@ # Set up the data structures for the target function. param_vector, full_tensors, full_in_ref_frame, rdcs, rdc_err, rdc_weight, rdc_vect, rdc_const, pcs, pcs_err, pcs_weight, atomic_pos, temp, frq, paramag_centre, com, ave_pos_pivot, pivot, pivot_opt = target_fn_data_setup(verbosity=0, unset_fail=True) + # The Sobol' integration information. + sobol_max_points, sobol_oversample = None, None + if hasattr(cdp, 'sobol_max_points'): + sobol_max_points = cdp.sobol_max_points + sobol_oversample = cdp.sobol_oversample + # Set up the optimisation target function class. - target_fn = Frame_order(model=cdp.model, init_params=param_vector, full_tensors=full_tensors, full_in_ref_frame=full_in_ref_frame, rdcs=rdcs, rdc_errors=rdc_err, rdc_weights=rdc_weight, rdc_vect=rdc_vect, dip_const=rdc_const, pcs=pcs, pcs_errors=pcs_err, pcs_weights=pcs_weight, atomic_pos=atomic_pos, temp=temp, frq=frq, paramag_centre=paramag_centre, scaling_matrix=None, com=com, ave_pos_pivot=ave_pos_pivot, pivot=pivot, pivot_opt=pivot_opt, sobol_max_points=cdp.sobol_max_points, sobol_oversample=cdp.sobol_oversample) + target_fn = Frame_order(model=cdp.model, init_params=param_vector, full_tensors=full_tensors, full_in_ref_frame=full_in_ref_frame, rdcs=rdcs, rdc_errors=rdc_err, rdc_weights=rdc_weight, rdc_vect=rdc_vect, dip_const=rdc_const, pcs=pcs, pcs_errors=pcs_err, pcs_weights=pcs_weight, atomic_pos=atomic_pos, temp=temp, frq=frq, paramag_centre=paramag_centre, scaling_matrix=None, com=com, ave_pos_pivot=ave_pos_pivot, pivot=pivot, pivot_opt=pivot_opt, sobol_max_points=sobol_max_points, sobol_oversample=sobol_oversample) # The Sobol' sequence dimensions. if cdp.model in [MODEL_ISO_CONE, MODEL_ISO_CONE_FREE_ROTOR, MODEL_PSEUDO_ELLIPSE, MODEL_PSEUDO_ELLIPSE_FREE_ROTOR]: