mailr19379 - /branches/relax_disp/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 on April 05, 2013 - 09:29:
Author: bugman
Date: Fri Apr  5 09:29:07 2013
New Revision: 19379

URL: http://svn.gna.org/viewcvs/relax?rev=19379&view=rev
Log:
The relaxation dispersion target function class back_calc variable now 
matches the values variable.

Instead of being a temporary structure which is overwritten for each spin and 
each exponential
curve, the structure now matches the dimensions of the values variable and 
hence is persistent per
function call.  This allows external code to access the structure - for 
example for data back
calculation in the relaxation dispersion specific analysis module.


Modified:
    branches/relax_disp/target_functions/relax_disp.py

Modified: branches/relax_disp/target_functions/relax_disp.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/relax_disp/target_functions/relax_disp.py?rev=19379&r1=19378&r2=19379&view=diff
==============================================================================
--- branches/relax_disp/target_functions/relax_disp.py (original)
+++ branches/relax_disp/target_functions/relax_disp.py Fri Apr  5 09:29:07 
2013
@@ -92,8 +92,8 @@
         if self.scaling_matrix != None:
             self.scaling_flag = True
 
-        # Create the structure for holding the back-calculated peak 
intensities.
-        self.back_calc = zeros(num_times, float64)
+        # Create the structure for holding the back-calculated peak 
intensities (matching the dimensions of the values structure so that external 
code can access this data).
+        self.back_calc = zeros((num_times, num_exp_curves, num_times), 
float64)
 
         # Set up the model.
         if model == 'exp_fit':
@@ -126,10 +126,10 @@
                 i0 = params[index + 1]
 
                 # Back-calculate the points on the exponential curve.
-                exponential_2param_neg(rate=r2eff, i0=i0, 
x=self.relax_times, y=self.back_calc)
+                exponential_2param_neg(rate=r2eff, i0=i0, 
x=self.relax_times, y=self.back_calc[spin_index, exp_index])
 
                 # Calculate the chi-squared value for this curve.
-                chi2_sum += chi2(self.values[spin_index, exp_index], 
self.back_calc, self.errors[spin_index, exp_index])
+                chi2_sum += chi2(self.values[spin_index, exp_index], 
self.back_calc[spin_index, exp_index], self.errors[spin_index, exp_index])
 
         # Return the chi-squared value.
         return chi2_sum




Related Messages


Powered by MHonArc, Updated Fri Apr 05 10:00:02 2013