mailr23803 - /branches/disp_spin_speed/lib/dispersion/cr72.py


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

Header


Content

Posted by tlinnet on June 10, 2014 - 20:58:
Author: tlinnet
Date: Tue Jun 10 20:58:19 2014
New Revision: 23803

URL: http://svn.gna.org/viewcvs/relax?rev=23803&view=rev
Log:
Code clean-up in lib function.

Task #7807 (https://gna.org/task/index.php?7807): Speed-up of dispersion 
models for Clustered analysis.

Modified:
    branches/disp_spin_speed/lib/dispersion/cr72.py

Modified: branches/disp_spin_speed/lib/dispersion/cr72.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/lib/dispersion/cr72.py?rev=23803&r1=23802&r2=23803&view=diff
==============================================================================
--- branches/disp_spin_speed/lib/dispersion/cr72.py     (original)
+++ branches/disp_spin_speed/lib/dispersion/cr72.py     Tue Jun 10 20:58:19 
2014
@@ -122,11 +122,6 @@
     @type num_points:       int
     """
 
-    # Initiate test masks.
-    #mask_dw_t = False
-    #mask_pA_t = False
-    #mask_kex_t = False
-
     # Flag to tell if values should be replaced if max_etapos in cosh 
function is violated.
     t_max_etapos = False
 
@@ -141,6 +136,7 @@
         if dw == 0.0 or pA == 1.0 or kex == 0.0:
             back_calc[:] = array([r20a]*num_points)
             return
+
     # For higher dimensions, return same structure.
     else:
        # Test if kex is zero.       
@@ -148,17 +144,15 @@
             back_calc[:] = r20a
             return
 
-        # Test if dw is zero.
-        if allclose(dw, zeros(dw.shape)):
-            #mask_dw_t = True
-            #mask_dw = ma.masked_values(dw, 0.0)
-            back_calc[:] = r20a
-            return
-
         # Test if pA is 1.
         if pA == 1.0:
             back_calc[:] = r20a
-            return            
+            return      
+
+        # Test if dw is zero.
+        if allclose(dw, zeros(dw.shape)):
+            back_calc[:] = r20a
+            return
 
     # The B population.
     pB = 1.0 - pA
@@ -220,12 +214,6 @@
     R2eff = r20_kex - cpmg_frqs * arccosh( fact )
 
     # Replace data in array.
-    #if mask_dw_t:
-    #    R2eff[mask_dw] = r20a
-    #if mask_pA_t:
-    #    R2eff[mask_pA] = r20a
-    #if mask_kex_t:
-    #    R2eff[mask_kex] = r20a
     if t_max_etapos:
         R2eff[mask_max_etapos.mask] = r20a[mask_max_etapos.mask]
 




Related Messages


Powered by MHonArc, Updated Tue Jun 10 21:00:02 2014