mailr18588 - in /trunk: generic_fns/structure/main.py user_functions/structure.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on March 01, 2013 - 18:18:
Author: bugman
Date: Fri Mar  1 18:18:44 2013
New Revision: 18588

URL: http://svn.gna.org/viewcvs/relax?rev=18588&view=rev
Log:
The structure.find_pivot user function now accepts the func_tol and box_limit 
arguments.

This allows the function tolerance for the simplex optimisation to be 
specified, as well as the
size of the box to constrain the pivot to be within.


Modified:
    trunk/generic_fns/structure/main.py
    trunk/user_functions/structure.py

Modified: trunk/generic_fns/structure/main.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/generic_fns/structure/main.py?rev=18588&r1=18587&r2=18588&view=diff
==============================================================================
--- trunk/generic_fns/structure/main.py (original)
+++ trunk/generic_fns/structure/main.py Fri Mar  1 18:18:44 2013
@@ -207,7 +207,7 @@
             cdp.structure.displacements._calculate(model_from=model_from[i], 
model_to=model_to[j], coord_from=array(coord_from), coord_to=array(coord_to), 
centroid=centroid)
 
 
-def find_pivot(models=None, atom_id=None, init_pos=None, func_tol=1e-5):
+def find_pivot(models=None, atom_id=None, init_pos=None, func_tol=1e-5, 
box_limit=200):
     """Superimpose a set of structural models.
 
     @keyword models:    The list of models to use.  If set to None, then all 
models will be used.
@@ -218,6 +218,8 @@
     @type init_pos:     list of float or numpy rank-1, 3D array
     @keyword func_tol:  The function tolerance which, when reached, 
terminates optimisation.  Setting this to None turns of the check.
     @type func_tol:     None or float
+    @keyword box_limit: The simplex optimisation used in this function is 
constrained withing a box of +/- x Angstrom containing the pivot point using 
the logarithmic barrier function.  This argument is the value of x.
+    @type box_limit:    int
     """
 
     # Test if the current data pipe exists.
@@ -252,8 +254,8 @@
     for i in range(3):
         A[2*i, i] = 1
         A[2*i+1, i] = -1
-        b[2*i] = -1000
-        b[2*i+1] = -1000
+        b[2*i] = -box_limit
+        b[2*i+1] = -box_limit
 
     # The target function.
     finder = Pivot_finder(models, coord)

Modified: trunk/user_functions/structure.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/user_functions/structure.py?rev=18588&r1=18587&r2=18588&view=diff
==============================================================================
--- trunk/user_functions/structure.py (original)
+++ trunk/user_functions/structure.py Fri Mar  1 18:18:44 2013
@@ -420,6 +420,20 @@
     desc_short = "initial pivot position",
     desc = "The initial position of the pivot.",
     can_be_none = True
+)
+uf.add_keyarg(
+    name = "func_tol",
+    default = 1e-5,
+    py_type = "num",
+    desc_short = "function tolerance",
+    desc = "The function tolerance.  This is used to terminate minimisation 
once the function value between iterations is less than the tolerance.  The 
default value is 1e-5."
+)
+uf.add_keyarg(
+    name = "box_limit",
+    default = 200,
+    py_type = "int",
+    desc_short = "box constraint limit",
+    desc = "The pivot point is constrained withing a box of +/- x Angstrom 
the using the logarithmic barrier function together with simplex 
optimisation.  This argument is the value of x."
 )
 # Description.
 uf.desc.append(Desc_container())




Related Messages


Powered by MHonArc, Updated Fri Mar 01 19:20:02 2013