Author: bugman
Date: Wed Sep 17 17:11:43 2014
New Revision: 25880
URL: http://svn.gna.org/viewcvs/relax?rev=25880&view=rev
Log:
Created the sobol_setup() method for the frame order auto-analysis.
This is used to correctly handle the new design of the frame_order.sobol_setup
user function
consistently throughout the protocol.
Modified:
branches/frame_order_cleanup/auto_analyses/frame_order.py
Modified: branches/frame_order_cleanup/auto_analyses/frame_order.py
URL:
http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/auto_analyses/frame_order.py?rev=25880&r1=25879&r2=25880&view=diff
==============================================================================
--- branches/frame_order_cleanup/auto_analyses/frame_order.py (original)
+++ branches/frame_order_cleanup/auto_analyses/frame_order.py Wed Sep 17
17:11:43 2014
@@ -133,8 +133,7 @@
# The numerical optimisation settings.
opt = self.opt_mc
- max_num, oversample = opt.get_min_sobol_info(0)
- self.interpreter.frame_order.sobol_setup(max_num=max_num,
oversample=oversample)
+ self.sobol_setup(opt.get_min_sobol_info(0))
# Monte Carlo simulations.
self.interpreter.monte_carlo.setup(number=self.mc_sim_num)
@@ -221,9 +220,7 @@
pass
# The numerical optimisation settings.
- max_num, oversample = opt.get_min_sobol_info(i)
- if max_num != None:
- self.interpreter.frame_order.sobol_setup(max_num=max_num,
oversample=oversample)
+ self.sobol_setup(opt.get_min_sobol_info(i))
# Perform the optimisation.
self.interpreter.minimise.execute(min_algor=opt.get_min_algor(i),
func_tol=opt.get_min_func_tol(i), max_iter=opt.get_min_max_iter(i))
@@ -597,9 +594,7 @@
self.interpreter.minimise.grid_zoom(level=zoom)
# The numerical optimisation settings.
- max_num, oversample = opt.get_grid_sobol_info(i)
- if max_num != None:
- self.interpreter.frame_order.sobol_setup(max_num=max_num,
oversample=oversample)
+ self.sobol_setup(opt.get_grid_sobol_info(i))
# Set up the custom grid increments.
incs = self.custom_grid_incs(model, inc=opt.get_grid_inc(i))
@@ -610,9 +605,7 @@
# Minimise (for the PCS data subset and full RDC set).
for i in opt.loop_min():
# The numerical optimisation settings.
- max_num, oversample = opt.get_min_sobol_info(i)
- if max_num != None:
- self.interpreter.frame_order.sobol_setup(max_num=max_num,
oversample=oversample)
+ self.sobol_setup(opt.get_min_sobol_info(i))
# Perform the optimisation.
self.interpreter.minimise.execute(min_algor=opt.get_min_algor(i),
func_tol=opt.get_min_func_tol(i), max_iter=opt.get_min_max_iter(i))
@@ -632,9 +625,7 @@
opt = self.opt_full
for i in opt.loop_min():
# The numerical optimisation settings.
- max_num, oversample = opt.get_min_sobol_info(i)
- if max_num != None:
- self.interpreter.frame_order.sobol_setup(max_num=max_num,
oversample=oversample)
+ self.sobol_setup(opt.get_min_sobol_info(i))
# Perform the optimisation.
self.interpreter.minimise.execute(min_algor=opt.get_min_algor(i),
func_tol=opt.get_min_func_tol(i), max_iter=opt.get_min_max_iter(i))
@@ -703,9 +694,7 @@
self.interpreter.minimise.grid_zoom(level=zoom)
# The numerical optimisation settings.
- max_num, oversample = opt.get_grid_sobol_info(i)
- if max_num != None:
- self.interpreter.frame_order.sobol_setup(max_num=max_num,
oversample=oversample)
+ self.sobol_setup(opt.get_grid_sobol_info(i))
# The number of increments.
inc = opt.get_grid_inc(i)
@@ -719,9 +708,7 @@
# Minimise.
for i in opt.loop_min():
# The numerical optimisation settings.
- max_num, oversample = opt.get_min_sobol_info(i)
- if max_num != None:
- self.interpreter.frame_order.sobol_setup(max_num=max_num,
oversample=oversample)
+ self.sobol_setup(opt.get_min_sobol_info(i))
# Perform the optimisation.
self.interpreter.minimise.execute(min_algor=opt.get_min_algor(i),
func_tol=opt.get_min_func_tol(i), max_iter=opt.get_min_max_iter(i))
@@ -885,6 +872,29 @@
return new
+ def sobol_setup(self, info=None):
+ """Correctly handle the frame_order.sobol_setup user function.
+
+ @keyword info: The information from the
Optimisation_settings.get_*_sobol_info() function.
+ @type info: tuple of int or None
+ """
+
+ # Unpack the info.
+ max_num, oversample = info
+
+ # Nothing to do.
+ if max_num == None:
+ return
+
+ # No oversampling specified.
+ if oversample == None:
+ self.interpreter.frame_order.sobol_setup(max_num=max_num)
+
+ # Full setup.
+ else:
+ self.interpreter.frame_order.sobol_setup(max_num=max_num,
oversample=oversample)
+
+
def visualisation(self, model=None):
"""Create visual representations of the frame order results for the
given model.
_______________________________________________
relax (http://www.nmr-relax.com)
This is the relax-commits mailing list
[email protected]
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