Author: bugman Date: Tue May 28 11:27:35 2013 New Revision: 19752 URL: http://svn.gna.org/viewcvs/relax?rev=19752&view=rev Log: Created the specific_analyses.relax_disp.disp_data.spin_has_frq_data() function. This is for determining if a spin has peak intensity for the given spectrometer field strength. 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=19752&r1=19751&r2=19752&view=diff ============================================================================== --- branches/relax_disp/specific_analyses/relax_disp/disp_data.py (original) +++ branches/relax_disp/specific_analyses/relax_disp/disp_data.py Tue May 28 11:27:35 2013 @@ -592,6 +592,26 @@ return cdp.spectrometer_frq[frq_index] +def spin_has_frq_data(spin=None, frq=None): + """Determine if the spin has intensity data for the given spectrometer frequency. + + @keyword spin: The specific spin data container. + @type spin: SpinContainer instance + @keyword frq: The spectrometer frequency. + @type frq: float + @return: True if data for that spectrometer frequency is present, False otherwise. + @rtype: bool + """ + + # Loop over the intensity data. + for key in spin.intensities.keys(): + if key in cdp.spectrometer_frq and cdp.spectrometer_frq[key] == frq: + return True + + # No data. + return False + + def spin_lock_field(spectrum_id=None, field=None): """Set the spin-lock field strength (nu1) for the given spectrum.