Author: bugman Date: Fri Jun 7 18:31:13 2013 New Revision: 19959 URL: http://svn.gna.org/viewcvs/relax?rev=19959&view=rev Log: Created the specific_analyses.relax_disp.disp_data.count_frq() function. This is for determining the number of spectrometer frequencies present, even if not data has been defined. Modified: branches/relax_disp/specific_analyses/relax_disp/disp_data.py Modified: branches/relax_disp/specific_analyses/relax_disp/disp_data.py URL: http://svn.gna.org/viewcvs/relax/branches/relax_disp/specific_analyses/relax_disp/disp_data.py?rev=19959&r1=19958&r2=19959&view=diff ============================================================================== --- branches/relax_disp/specific_analyses/relax_disp/disp_data.py (original) +++ branches/relax_disp/specific_analyses/relax_disp/disp_data.py Fri Jun 7 18:31:13 2013 @@ -111,6 +111,21 @@ return intensity +def count_frq(): + """Count the number of spectrometer frequencies present. + + @return: The spectrometer frequency count + @rtype: int + """ + + # Handle missing frequency data. + if not hasattr(cdp, 'spectrometer_frq'): + return 1 + + # The normal count variable. + return cdp.spectrometer_frq_count + + def cpmg_frq(spectrum_id=None, cpmg_frq=None): """Set the CPMG frequency associated with a given spectrum.