Author: tlinnet Date: Tue Feb 25 15:04:51 2014 New Revision: 22302 URL: http://svn.gna.org/viewcvs/relax?rev=22302&view=rev Log: Made count_relax_times() take optional arguments as: exp_type, frq, offset, point. Regarding bug #21665, (https://gna.org/bugs/?21665) - Running a CPMG analysis with two fields at two delay times. This is prepare for re-stricting the looping over time points in the function: loop_time() This is implemented as suggested in: http://www.mail-archive.com/relax-devel@xxxxxxx/msg04993.html Modified: trunk/specific_analyses/relax_disp/disp_data.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=22302&r1=22301&r2=22302&view=diff ============================================================================== --- trunk/specific_analyses/relax_disp/disp_data.py (original) +++ trunk/specific_analyses/relax_disp/disp_data.py Tue Feb 25 15:04:51 2014 @@ -182,18 +182,26 @@ return cdp.spectrometer_frq_count -def count_relax_times(ei=None): +def count_relax_times(exp_type=None, frq=None, offset=None, point=None, ei=None): """Count the number of relaxation times present. - @keyword ei: The experiment type index. - @type ei: str - @return: The relaxation time count for the given experiment. - @rtype: int + @keyword exp_type: The experiment type. + @type exp_type: str + @keyword frq: The spectrometer frequency in Hz. + @type frq: float + @keyword offset: The spin-lock or hard pulse offset value in ppm. + @type offset: None or float + @keyword point: The dispersion point data (either the spin-lock field strength in Hz or the nu_CPMG frequency in Hz). + @type point: float + @keyword ei: The experiment type index. + @type ei: str + @return: The relaxation time count for the given experiment. + @rtype: int """ # Loop over the times. count = 0 - for time in loop_time(): + for time in loop_time(exp_type=exp_type, frq=frq, offset=offset, point=point): # Find a matching experiment ID. found = False for id in cdp.exp_type.keys(): @@ -402,7 +410,7 @@ else: # Determine the curve type. curve_type = 'exponential' - if count_relax_times(cdp.exp_type_list.index(cdp.exp_type[id])) == 1: + if count_relax_times(ei = cdp.exp_type_list.index(cdp.exp_type[id])) == 1: curve_type = 'fixed time' # Return the type.