Author: tlinnet Date: Tue May 27 19:30:02 2014 New Revision: 23487 URL: http://svn.gna.org/viewcvs/relax?rev=23487&view=rev Log: Fix for looking for negative values, when all values where converted to positive in matrix in ns_cpmg_2site_3d.py. This is to implement catching of math domain errors, before they occur. This follows from the ideas in the post http://article.gmane.org/gmane.science.nmr.relax.devel/5858. This is related to: task #7793: (https://gna.org/task/?7793) Speed-up of dispersion models. Modified: branches/disp_speed/lib/dispersion/ns_cpmg_2site_3d.py Modified: branches/disp_speed/lib/dispersion/ns_cpmg_2site_3d.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_speed/lib/dispersion/ns_cpmg_2site_3d.py?rev=23487&r1=23486&r2=23487&view=diff ============================================================================== --- branches/disp_speed/lib/dispersion/ns_cpmg_2site_3d.py (original) +++ branches/disp_speed/lib/dispersion/ns_cpmg_2site_3d.py Tue May 27 19:30:02 2014 @@ -54,7 +54,7 @@ """ # Python module imports. -from math import fabs, log +from math import log from numpy import dot # relax module imports. @@ -127,7 +127,7 @@ Mint = dot(Rexpo, Mint) # The next lines calculate the R2eff using a two-point approximation, i.e. assuming that the decay is mono-exponential. - Mx = fabs(Mint[1] / pA) + Mx = Mint[1] / pA if Mx <= 0.0 or isNaN(Mx): for i in range(num_points): back_calc[i] = r20a