Author: bugman Date: Fri Nov 29 15:14:01 2013 New Revision: 21721 URL: http://svn.gna.org/viewcvs/relax?rev=21721&view=rev Log: Another fix for bug #21309, the 'R2eff' dispersion model failure when peak intensity data is missing. The bug is reported at https://gna.org/bugs/?21309. This second problem is only for the numeric CPMG models for when all data at one magnetic field strength is missing. When the relaxation dispersion target function is being set up, the creation of the self.power data structure holding the number of CPMG blocks fails. The problem is that the relaxation time for the missing field strength is set to NaN. This is now caught using lib.float.isNaN(). Modified: trunk/target_functions/relax_disp.py Modified: trunk/target_functions/relax_disp.py URL: http://svn.gna.org/viewcvs/relax/trunk/target_functions/relax_disp.py?rev=21721&r1=21720&r2=21721&view=diff ============================================================================== --- trunk/target_functions/relax_disp.py (original) +++ trunk/target_functions/relax_disp.py Fri Nov 29 15:14:01 2013 @@ -48,6 +48,7 @@ from lib.dispersion.tap03 import r1rho_TAP03 from lib.dispersion.tsmfk01 import r2eff_TSMFK01 from lib.errors import RelaxError +from lib.float import isNaN from target_functions.chi2 import chi2 from specific_analyses.relax_disp.variables import EXP_TYPE_CPMG_DQ, EXP_TYPE_CPMG_MQ, EXP_TYPE_CPMG_PROTON_MQ, EXP_TYPE_CPMG_PROTON_SQ, EXP_TYPE_CPMG_SQ, EXP_TYPE_CPMG_ZQ, EXP_TYPE_R1RHO, MODEL_CR72, MODEL_CR72_FULL, MODEL_DPL94, MODEL_IT99, MODEL_LIST_CPMG, MODEL_LIST_FULL, MODEL_LIST_MMQ, MODEL_LIST_MQ_CPMG, MODEL_LIST_R1RHO, MODEL_LM63, MODEL_LM63_3SITE, MODEL_M61, MODEL_M61B, MODEL_MMQ_2SITE, MODEL_MP05, MODEL_MQ_CR72, MODEL_NOREX, MODEL_NS_CPMG_2SITE_3D, MODEL_NS_CPMG_2SITE_3D_FULL, MODEL_NS_CPMG_2SITE_EXPANDED, MODEL_NS_CPMG_2SITE_STAR, MODEL_NS_CPMG_2SITE_STAR_FULL, MODEL_NS_R1RHO_2SITE, MODEL_R2EFF, MODEL_TAP03, MODEL_TP02, MODEL_TSMFK01 @@ -231,7 +232,13 @@ for frq_index in range(self.num_frq): self.power[exp_type_index].append(zeros(self.num_disp_points[exp_type_index][frq_index], int16)) for i in range(self.num_disp_points[exp_type_index][frq_index]): - self.power[exp_type_index][frq_index][i] = int(round(self.cpmg_frqs[exp_type_index][frq_index][i] * self.relax_times[exp_type_index][frq_index])) + # Missing data for an entire field strength. + if isNaN(self.relax_times[exp_type_index][frq_index]): + self.power[exp_type_index][frq_index][i] = 0.0 + + # Normal value. + else: + self.power[exp_type_index][frq_index][i] = int(round(self.cpmg_frqs[exp_type_index][frq_index][i] * self.relax_times[exp_type_index][frq_index])) # The tau_cpmg times. self.tau_cpmg = []