Author: bugman Date: Wed Dec 4 11:51:08 2013 New Revision: 21766 URL: http://svn.gna.org/viewcvs/relax?rev=21766&view=rev Log: Bug fixes for the dispersion analysis when certain data sets are completely missing. Modified: trunk/specific_analyses/relax_disp/disp_data.py trunk/target_functions/relax_disp.py Modified: trunk/specific_analyses/relax_disp/disp_data.py URL: http://svn.gna.org/viewcvs/relax/trunk/specific_analyses/relax_disp/disp_data.py?rev=21766&r1=21765&r2=21766&view=diff ============================================================================== --- trunk/specific_analyses/relax_disp/disp_data.py (original) +++ trunk/specific_analyses/relax_disp/disp_data.py Wed Dec 4 11:51:08 2013 @@ -1186,6 +1186,10 @@ # Add a new dimension. cpmg_frqs_new[exp_type_index].append([]) + # No data. + if not len(cpmg_frqs[exp_type_index][frq_index]): + continue + # The minimum frequency unit. min_frq = 1.0 / relax_times[exp_type_index][frq_index] max_frq = max(cpmg_frqs[exp_type_index][frq_index]) + round(extend / min_frq) * min_frq @@ -1213,6 +1217,10 @@ # Add a new dimension. cpmg_frqs_new[exp_type_index].append([]) + # No data. + if not len(cpmg_frqs[exp_type_index][frq_index]): + continue + # Interpolate (adding the extended amount to the end). for point_index in range(num_points): point = (point_index + 1) * (max(cpmg_frqs[exp_type_index][frq_index])+extend) / num_points @@ -1233,6 +1241,10 @@ for frq_index in range(len(spin_lock_nu1[exp_type_index])): # Add a new dimension. spin_lock_nu1_new[exp_type_index].append([]) + + # No data. + if not len(spin_lock_nu1[exp_type_index][frq_index]): + continue # Interpolate (adding the extended amount to the end). for point_index in range(num_points): @@ -2485,8 +2497,8 @@ values[-1][-1].append([]) errors[-1][-1].append([]) missing[-1][-1].append([]) - frqs[-1][-1].append(None) - frqs_H[-1][-1].append(None) + frqs[-1][-1].append(0.0) + frqs_H[-1][-1].append(0.0) for field_i in range(field_count): relax_times[-1].append(None) Modified: trunk/target_functions/relax_disp.py URL: http://svn.gna.org/viewcvs/relax/trunk/target_functions/relax_disp.py?rev=21766&r1=21765&r2=21766&view=diff ============================================================================== --- trunk/target_functions/relax_disp.py (original) +++ trunk/target_functions/relax_disp.py Wed Dec 4 11:51:08 2013 @@ -106,9 +106,9 @@ @keyword missing: The data structure indicating missing R2eff/R1rho data. The dimensions must correspond to those of the values argument. @type missing: list of lists of lists of numpy rank-1 int arrays @keyword frqs: The spin Larmor frequencies (in MHz*2pi to speed up the ppm to rad/s conversion). The dimensions correspond to the first three of the value, error and missing structures. - @type frqs: list of lists of numpy rank-1 float arrays + @type frqs: list of lists of floats @keyword frqs_H: The proton spin Larmor frequencies for the MMQ-type models (in MHz*2pi to speed up the ppm to rad/s conversion). The dimensions correspond to the first three of the value, error and missing structures. - @type frqs_H: list of lists of numpy rank-1 float arrays + @type frqs_H: list of lists of floats @keyword cpmg_frqs: The CPMG frequencies in Hertz for each separate dispersion point. This will be ignored for R1rho experiments. @type cpmg_frqs: list of lists of lists of floats @keyword spin_lock_nu1: The spin-lock field strengths in Hertz for each separate dispersion point. This will be ignored for CPMG experiments. @@ -178,8 +178,10 @@ self.num_disp_points[-1].append([]) if cpmg_frqs != None and len(cpmg_frqs[exp_type_index][frq_index]): self.num_disp_points[-1][-1] = len(self.cpmg_frqs[exp_type_index][frq_index]) + elif spin_lock_nu1 != None and len(spin_lock_nu1[exp_type_index][frq_index]): + self.num_disp_points[-1][-1] = len(self.spin_lock_nu1[exp_type_index][frq_index]) else: - self.num_disp_points[-1][-1] = len(self.spin_lock_nu1[exp_type_index][frq_index]) + self.num_disp_points[-1][-1] = 0 # Scaling initialisation. self.scaling_flag = False