mailRe: r23951 - /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 Edward d'Auvergne on June 15, 2014 - 10:10:
Hi Troels,

For the API consistency here, you should also shift the following
loops into the lib.dispersion module:

        # Loop over the spins.
        for si in range(self.num_spins):
            # Loop over the spectrometer frequencies.
            for mi in range(self.num_frq):

The aim would be to have zero loops in any of the dispersion func_*()
target functions.  Everything happens within the lib.dispersion
modules.  So if one of the models requires looping as it cannot be
simplified, as will be the case for most numeric modles, that happens
within the lib.dispersion module, hidden from the
target_function.relax_disp module.  This way the
target_functions.relax_disp to lib.dispersion API will be consistent.
It also allows for all future optimisations to happen in one place
rather than in both target_functions.relax_disp and lib.dispersion
simultaneously.

Regards,

Edward


On 15 June 2014 08:53,  <tlinnet@xxxxxxxxxxxxx> wrote:
Author: tlinnet
Date: Sun Jun 15 08:53:36 2014
New Revision: 23951

URL: http://svn.gna.org/viewcvs/relax?rev=23951&view=rev
Log:
Change to the target function to the model ns cpmg 2site 3d to use the 
reduced input to the lib function.

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=23951&r1=23950&r2=23951&view=diff
==============================================================================
--- branches/disp_spin_speed/target_functions/relax_disp.py     (original)
+++ branches/disp_spin_speed/target_functions/relax_disp.py     Sun Jun 15 
08:53:36 2014
@@ -627,15 +627,6 @@
         @rtype:         float
         """

-        # Once off parameter conversions.
-        pB = 1.0 - pA
-        k_BA = pA * kex
-        k_AB = pB * kex
-
-        # This is a vector that contains the initial magnetizations 
corresponding to the A and B state transverse magnetizations.
-        self.M0[1] = pA
-        self.M0[4] = pB
-
         # Chi-squared initialisation.
         chi2_sum = 0.0

@@ -650,7 +641,7 @@
                 dw_frq = dw[si] * self.frqs[0][si][mi]

                 # Back calculate the R2eff values.
-                r2eff_ns_cpmg_2site_3D(r180x=self.r180x, M0=self.M0, 
r20a=R20A[r20_index], r20b=R20B[r20_index], pA=pA, pB=pB, dw=dw_frq, 
k_AB=k_AB, k_BA=k_BA, inv_tcpmg=self.inv_relax_times[0][mi], 
tcp=self.tau_cpmg[0][mi], back_calc=self.back_calc[0][si][mi][0], 
num_points=self.num_disp_points[0][si][mi][0], power=self.power[0][mi])
+                r2eff_ns_cpmg_2site_3D(r180x=self.r180x, M0=self.M0, 
r20a=R20A[r20_index], r20b=R20B[r20_index], pA=pA, dw=dw_frq, kex=kex, 
inv_tcpmg=self.inv_relax_times[0][mi], tcp=self.tau_cpmg[0][mi], 
back_calc=self.back_calc[0][si][mi][0], 
num_points=self.num_disp_points[0][si][mi][0], power=self.power[0][mi])

                 # For all missing data points, set the back-calculated 
value to the measured values so that it has no effect on the chi-squared 
value.
                 for di in range(self.num_disp_points[0][si][mi][0]):


_______________________________________________
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



Related Messages


Powered by MHonArc, Updated Sun Jun 15 15:40:13 2014