mailr23297 - /branches/disp_speed/lib/dispersion/it99.py


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

Header


Content

Posted by tlinnet on May 21, 2014 - 13:02:
Author: tlinnet
Date: Wed May 21 13:02:58 2014
New Revision: 23297

URL: http://svn.gna.org/viewcvs/relax?rev=23297&view=rev
Log:
Align math-domain catching for model IT99 with trunk implementation.

task #7793: (https://gna.org/task/?7793) Speed-up of dispersion models.

This is to implement catching of math domain errors, before they occur.

The catching of errors have to be more careful.

Modified:
    branches/disp_speed/lib/dispersion/it99.py

Modified: branches/disp_speed/lib/dispersion/it99.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/disp_speed/lib/dispersion/it99.py?rev=23297&r1=23296&r2=23297&view=diff
==============================================================================
--- branches/disp_speed/lib/dispersion/it99.py  (original)
+++ branches/disp_speed/lib/dispersion/it99.py  Wed May 21 13:02:58 2014
@@ -107,6 +107,11 @@
     # The numerator.
     numer = padw2 * pB * tex
 
+    # Catch zeros (to avoid pointless mathematical operations).
+    # This will result in no exchange, returning flat lines.
+    if numer == 0.0:
+        return array([r20]*num_points)
+
     # The effective rotating frame field.
     omega_1eff4 = 2304.0 * cpmg_frqs**4
 




Related Messages


Powered by MHonArc, Updated Wed May 21 13:20:03 2014