mailr23804 - /branches/disp_spin_speed/target_functions/relax_disp.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:22 2014
New Revision: 23804

URL: http://svn.gna.org/viewcvs/relax?rev=23804&view=rev
Log:
Replace np.tile with tile.

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

Modified:
    branches/disp_spin_speed/target_functions/relax_disp.py

Modified: branches/disp_spin_speed/target_functions/relax_disp.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/target_functions/relax_disp.py?rev=23804&r1=23803&r2=23804&view=diff
==============================================================================
--- branches/disp_spin_speed/target_functions/relax_disp.py     (original)
+++ branches/disp_spin_speed/target_functions/relax_disp.py     Tue Jun 10 
20:58:22 2014
@@ -27,8 +27,7 @@
 # Python module imports.
 from copy import deepcopy
 from math import pi
-from numpy import array, asarray, complex64, dot, float64, int16, max, ones, 
sqrt, sum, zeros
-import numpy as np
+from numpy import array, asarray, complex64, dot, float64, int16, max, ones, 
sqrt, sum, tile, zeros
 from numpy.ma import masked_equal
 
 # relax module imports.
@@ -553,7 +552,7 @@
         dw_axis = dw_axis[:,:,None,None,None]
 
         # Tile dw according to dimensions.
-        dw_axis = np.tile(dw_axis, (1, 1, self.numpy_array_shape[2], 
self.numpy_array_shape[3], self.numpy_array_shape[4]))
+        dw_axis = tile(dw_axis, (1, 1, self.numpy_array_shape[2], 
self.numpy_array_shape[3], self.numpy_array_shape[4]))
 
         # Convert dw from ppm to rad/s.
         dw_frq_a = dw_axis*self.spins_a*self.frqs_a
@@ -567,8 +566,8 @@
         R20B_axis = R20B_axis[:,:,:,None,None]
 
         # Tile R20A and R20B according to maximum of dispersion points. 
Multiply with spin structure array.
-        R20A_axis = np.tile(R20A_axis, (1, 1, 1, self.numpy_array_shape[3], 
self.numpy_array_shape[4])) * self.spins_a
-        R20B_axis = np.tile(R20B_axis, (1, 1, 1, self.numpy_array_shape[3], 
self.numpy_array_shape[4])) * self.spins_a
+        R20A_axis = tile(R20A_axis, (1, 1, 1, self.numpy_array_shape[3], 
self.numpy_array_shape[4])) * self.spins_a
+        R20B_axis = tile(R20B_axis, (1, 1, 1, self.numpy_array_shape[3], 
self.numpy_array_shape[4])) * self.spins_a
 
         ## Back calculate the R2eff values.
         r2eff_CR72(r20a=R20A_axis, r20b=R20B_axis, pA=pA, dw=dw_frq_a, 
kex=kex, cpmg_frqs=self.cpmg_frqs_a, back_calc=self.back_calc_a, 
num_points=self.num_disp_points_a)




Related Messages


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