Author: tlinnet Date: Tue May 20 01:47:32 2014 New Revision: 23247 URL: http://svn.gna.org/viewcvs/relax?rev=23247&view=rev Log: Math-domain catching for model CR72. task #7793: (https://gna.org/task/?7793) Speed-up of dispersion models. This is to implement catching of math domain errors, before they occur. These can be found via the --numpy-raise function to the systemtests. The skipping of test when num_points > 0, is a bad implementation. If such a case should show, it is best to catch the wrong input for the calculations. This is best done with a check before running the calculations. Modified: branches/disp_speed/lib/dispersion/cr72.py Modified: branches/disp_speed/lib/dispersion/cr72.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_speed/lib/dispersion/cr72.py?rev=23247&r1=23246&r2=23247&view=diff ============================================================================== --- branches/disp_speed/lib/dispersion/cr72.py (original) +++ branches/disp_speed/lib/dispersion/cr72.py Tue May 20 01:47:32 2014 @@ -151,11 +151,10 @@ # Catch math domain error of cosh(val > 710). # This is when etapos > 710. - if num_points > 0: - if max(etapos) > 700: - R2eff = array([1e100]*num_points) + if max(etapos) > 700: + R2eff = array([1e100]*num_points) - return R2eff + return R2eff # Calculate R2eff. R2eff = r20_kex - cpmg_frqs * arccosh( Dpos * cosh(etapos) - Dneg * cos(etaneg) )