Author: tlinnet
Date: Mon Sep 1 01:16:17 2014
New Revision: 25495
URL: http://svn.gna.org/viewcvs/relax?rev=25495&view=rev
Log:
Fix for inf values beeing returned from C-code exponential function. Values are
now converted to high values.
This fixes systemtest Relax_disp.test_finite_value.
Example:
x = np.array([np.inf, -np.inf, np.nan, -128, 128])
np.nan_to_num(x)
array([ 1.79769313e+308, -1.79769313e+308, 0.00000000e+000,
-1.28000000e+002, 1.28000000e+002])
bug #22552(https://gna.org/bugs/index.php?22552): Chi2 value returned from
C-code Curve-fitting return 0.0 for wrong parameters -> Expected influence on
Monte-Carlo sim.
Ref: http://docs.scipy.org/doc/numpy/reference/generated/numpy.nan_to_num.html
Modified:
trunk/specific_analyses/relax_fit/optimisation.py
Modified: trunk/specific_analyses/relax_fit/optimisation.py
URL:
http://svn.gna.org/viewcvs/relax/trunk/specific_analyses/relax_fit/optimisation.py?rev=25495&r1=25494&r2=25495&view=diff
==============================================================================
--- trunk/specific_analyses/relax_fit/optimisation.py (original)
+++ trunk/specific_analyses/relax_fit/optimisation.py Mon Sep 1 01:16:17 2014
@@ -23,7 +23,7 @@
"""The R1 and R2 exponential relaxation curve fitting optimisation
functions."""
# Python module imports.
-from numpy import array, float64, ndarray
+from numpy import array, float64, ndarray, nan_to_num
# relax module imports.
from dep_check import C_module_exp_fn
@@ -95,7 +95,7 @@
chi2 = func(params)
# Return the chi2 value.
- return chi2
+ return nan_to_num(chi2)
def dfunc_wrapper(params):
_______________________________________________
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