Author: bugman Date: Thu Jul 17 14:27:50 2014 New Revision: 24546 URL: http://svn.gna.org/viewcvs/relax?rev=24546&view=rev Log: Created the new minimise.grid_zoom user function. This allows the grid zoom level to be set. The value is stored in the current data pipe and will be used later by the minimise.grid_search user function. Modified: branches/zooming_grid_search/pipe_control/minimise.py branches/zooming_grid_search/user_functions/minimisation.py Modified: branches/zooming_grid_search/pipe_control/minimise.py URL: http://svn.gna.org/viewcvs/relax/branches/zooming_grid_search/pipe_control/minimise.py?rev=24546&r1=24545&r2=24546&view=diff ============================================================================== --- branches/zooming_grid_search/pipe_control/minimise.py (original) +++ branches/zooming_grid_search/pipe_control/minimise.py Thu Jul 17 14:27:50 2014 @@ -146,6 +146,33 @@ # Execute any queued commands. processor.run_queue() + + +def grid_zoom(level=0): + """Store the grid zoom level. + + The zoom level can be one of: + + 0: No zooming - setting this value will deactivate the zooming grid search. + 1: 1st level zoom. This will activate the first zoom level. For the frame order parameters, excluding the pivot point, this will halve the grid upper and lower bound values and center the grid at the current parameter values. + 2: 2nd level zoom. This will activate the second zoom level. For the frame order parameters, excluding the pivot point, this will zoom the grid upper and lower bound values by a quarter (1/2^2). + 3: 3rd level zoom. This will activate the second zoom level. For the frame order parameters, excluding the pivot point, this will zoom the grid upper and lower bound values by an eighth (1/2^3). + + + @keyword level: The zoom level. + @type level: int + """ + + # Test if the current data pipe exists. + pipes.test() + + # Check the value. + allowed = [0, 1, 2, 3] + if level not in allowed: + raise RelaxError("The grid zoom level of '%s' is not valid, it must be one of %s." % (level, allowed)) + + # Store the values. + cdp.grid_zoom_level = level def minimise(min_algor=None, line_search=None, hessian_mod=None, hessian_type=None, func_tol=None, grad_tol=None, max_iter=None, constraints=True, scaling=True, verbosity=1, sim_index=None): Modified: branches/zooming_grid_search/user_functions/minimisation.py URL: http://svn.gna.org/viewcvs/relax/branches/zooming_grid_search/user_functions/minimisation.py?rev=24546&r1=24545&r2=24546&view=diff ============================================================================== --- branches/zooming_grid_search/user_functions/minimisation.py (original) +++ branches/zooming_grid_search/user_functions/minimisation.py Thu Jul 17 14:27:50 2014 @@ -109,6 +109,47 @@ uf.menu_text = "&grid_search" uf.gui_icon = "relax.grid_search" uf.wizard_size = (800, 500) +uf.wizard_image = WIZARD_IMAGE_PATH + 'minimise.png' + + +# The minimise.grid_zoom user function. +uf = uf_info.add_uf('minimise.grid_zoom') +uf.title = "Change the zoom level for the grid search." +uf.title_short = "Zooming grid search level." +uf.add_keyarg( + name = "level", + default = 0, + py_type = "int", + desc_short = "zoom level", + desc = "The zooming grid search level.", + wiz_element_type = "combo", + wiz_combo_choices = [ + "No zooming", + "1st level zoom", + "2nd level zoom", + "3rd level zoom" + ], + wiz_combo_data = [ + 0, + 1, + 2, + 3 + ], + wiz_read_only = True +) +# Description. +uf.desc.append(Desc_container()) +uf.desc[-1].add_paragraph("This user function activates or deactivates a zooming grid search. The zooming grid search level can be one of:") +uf.desc[-1].add_item_list_element("0", "No zooming - setting this value will deactivate the zooming grid search.") +uf.desc[-1].add_item_list_element("1", "1st level zoom. This will activate the first zoom level. For the frame order parameters, excluding the pivot point, this will halve the grid upper and lower bound values and center the grid at the current parameter values.") +uf.desc[-1].add_item_list_element("2", "2nd level zoom. This will activate the second zoom level. For the frame order parameters, excluding the pivot point, this will zoom the grid upper and lower bound values by a quarter (1/2^2).") +uf.desc[-1].add_item_list_element("3", "3rd level zoom. This will activate the second zoom level. For the frame order parameters, excluding the pivot point, this will zoom the grid upper and lower bound values by an eighth (1/2^3).") +uf.desc[-1].add_paragraph("For all zoom levels, except for 0, the grid will be centred at the current parameter values.") +uf.backend = minimise.grid_zoom +uf.menu_text = "&grid_zoom" +uf.gui_icon = "relax.grid_search" +uf.wizard_height_desc = 500 +uf.wizard_size = (900, 600) uf.wizard_image = WIZARD_IMAGE_PATH + 'minimise.png'