mailr23840 - /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 11, 2014 - 15:25:
Author: tlinnet
Date: Wed Jun 11 15:25:34 2014
New Revision: 23840

URL: http://svn.gna.org/viewcvs/relax?rev=23840&view=rev
Log:
Made the lib function into a pure numpy array calculation.

This requires, that r20a, r20b and dw has same dimension as the dispersion 
points.

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=23840&r1=23839&r2=23840&view=diff
==============================================================================
--- branches/disp_spin_speed/lib/dispersion/cr72.py     (original)
+++ branches/disp_spin_speed/lib/dispersion/cr72.py     Wed Jun 11 15:25:34 
2014
@@ -187,19 +187,11 @@
     # Replace data in array.
     # If dw is zero.
     if t_dw_zero:
-        if isinstance(r20a, float):
-            back_calc[:] = array([r20a]*num_points)
-            return
-        else:
-            back_calc[mask_dw_zero.mask] = r20a[mask_dw_zero.mask]
+        back_calc[mask_dw_zero.mask] = r20a[mask_dw_zero.mask]
 
     # If eta_pos above 700.
     if t_max_etapos:
-        if isinstance(r20a, float):
-            back_calc[:] = array([r20a]*num_points)
-            return
-        else:
-            back_calc[mask_max_etapos.mask] = r20a[mask_max_etapos.mask]
+        back_calc[mask_max_etapos.mask] = r20a[mask_max_etapos.mask]
 
     # Catch errors, taking a sum over array is the fastest way to check for
     # +/- inf (infinity) and nan (not a number).




Related Messages


Powered by MHonArc, Updated Wed Jun 11 15:40:02 2014