mailRe: r23735 - /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 Troels Emtekær Linnet on June 10, 2014 - 12:09:
You are Correct !!!

The final version is:
pA_arr = pA*self.spins_a

The "trick" was to make a numpy multi dimensional spin array in the
__init__ function of the class.

That is filled with 1.0 where there are dispersion points.

This array essential replace the spin looping!

Best
Troels




2014-06-10 11:56 GMT+02:00 Edward d'Auvergne <edward@xxxxxxxxxxxxx>:
Hi Troels,

From the dispersion equations, to me it looks like that you can keep
pA as a single value.  Why have you converted it to an array
structure?  You will have no problems as you can multiply any numpy
array with a single float.  This should be the same for all model
parameters, excluding dw and R20.  If you can use single values, that
should be much quicker for the target functions.

Regards,

Edward



On 8 June 2014 19:48,  <tlinnet@xxxxxxxxxxxxx> wrote:
Author: tlinnet
Date: Sun Jun  8 19:48:31 2014
New Revision: 23735

URL: http://svn.gna.org/viewcvs/relax?rev=23735&view=rev
Log:
Important fix for the creation of the multi dimensional pA numpy array.

It should be created as numpy.zeros([ei][si][mi][oi]) instead of 
numpy.ones([ei][si][mi][oi]).

This allows for rapid testing of all dimensions with np.allclose(pA, 
numpy.ones(dw.shape)).
pA can have missing filled out values, when the number of dispersion 
points are different
per spectrometer frequency.

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=23735&r1=23734&r2=23735&view=diff
==============================================================================
--- branches/disp_spin_speed/target_functions/relax_disp.py     (original)
+++ branches/disp_spin_speed/target_functions/relax_disp.py     Sun Jun  8 
19:48:31 2014
@@ -411,7 +411,7 @@
             # The number of disp point can change per spectrometer, so we 
make the maximum size.
             self.R20A_a = np.ones(back_calc_shape + 
[self.max_num_disp_points])
             self.R20B_a = np.ones(back_calc_shape + 
[self.max_num_disp_points])
-            self.pA_a = np.ones(back_calc_shape + 
[self.max_num_disp_points])
+            self.pA_a = np.zeros(back_calc_shape + 
[self.max_num_disp_points])
             self.dw_frq_a = np.ones(back_calc_shape + 
[self.max_num_disp_points])
             self.kex_a = np.ones(back_calc_shape + 
[self.max_num_disp_points])
             self.cpmg_frqs_a = np.ones(back_calc_shape + 
[self.max_num_disp_points])


_______________________________________________
relax (http://www.nmr-relax.com)

This is the relax-commits mailing list
relax-commits@xxxxxxx

To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-commits

_______________________________________________
relax (http://www.nmr-relax.com)

This is the relax-devel mailing list
relax-devel@xxxxxxx

To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-devel



Related Messages


Powered by MHonArc, Updated Tue Jun 10 14:00:13 2014