Author: tlinnet Date: Tue Jun 17 11:56:45 2014 New Revision: 24019 URL: http://svn.gna.org/viewcvs/relax?rev=24019&view=rev Log: Moved the cleaning of data points and replacing of values of out loop for model ns mmq 2site. 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=24019&r1=24018&r2=24019&view=diff ============================================================================== --- branches/disp_spin_speed/target_functions/relax_disp.py (original) +++ branches/disp_spin_speed/target_functions/relax_disp.py Tue Jun 17 11:56:45 2014 @@ -1560,20 +1560,16 @@ # Back calculate the R2eff values for each experiment type. self.r2eff_ns_mmq[ei](M0=self.M0, m1=self.m1, m2=self.m2, R20A=r20, R20B=r20, pA=pA, pB=pB, dw=aliased_dw, dwH=aliased_dwH, k_AB=k_AB, k_BA=k_BA, inv_tcpmg=self.inv_relax_times[ei], tcp=self.tau_cpmg[ei], back_calc=self.back_calc[ei], num_points=self.num_disp_points[ei], power=self.power[ei]) - # Clean the data for all values, which is left over at the end of arrays. - self.back_calc[ei] = self.back_calc[ei]*self.disp_struct[ei] - - # 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. - if self.has_missing: - # Replace with values. - mask_replace_blank_ei = masked_equal(self.missing, 1.0) - self.back_calc[mask_replace_blank_ei.mask] = self.values[mask_replace_blank_ei.mask] - - # Calculate and return the chi-squared value. - chi2_sum += chi2_rankN(self.values[ei], self.back_calc[ei], self.errors[ei]) + # Clean the data for all values, which is left over at the end of arrays. + self.back_calc = self.back_calc*self.disp_struct + + ## 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. + if self.has_missing: + # Replace with values. + self.back_calc[self.mask_replace_blank.mask] = self.values[self.mask_replace_blank.mask] # Return the total chi-squared value. - return chi2_sum + return chi2_rankN(self.values, self.back_calc, self.errors) def func_ns_mmq_3site(self, params):