Author: bugman Date: Thu Oct 31 09:14:27 2013 New Revision: 21348 URL: http://svn.gna.org/viewcvs/relax?rev=21348&view=rev Log: Created the pipe_control.spectrometer.get_frequency() function for returning the frequency for a given ID. Modified: trunk/pipe_control/spectrometer.py Modified: trunk/pipe_control/spectrometer.py URL: http://svn.gna.org/viewcvs/relax/trunk/pipe_control/spectrometer.py?rev=21348&r1=21347&r2=21348&view=diff ============================================================================== --- trunk/pipe_control/spectrometer.py (original) +++ trunk/pipe_control/spectrometer.py Thu Oct 31 09:14:27 2013 @@ -141,6 +141,23 @@ warn(RelaxWarning("The proton frequency of %s Hz appears to be too low." % frq)) if frq > 2e9: warn(RelaxWarning("The proton frequency of %s Hz appears to be too high." % frq)) + + +def get_frequency(id=None): + """Return the frequency corresponding to the given ID. + + @param id: The experiment ID string. + @type id: str + @return: The spectrometer proton frequency in Hertz for the given ID. + @rtype: float + """ + + # Checks. + pipes.test() + check_frequency(id=id) + + # Return the frequency in Hz. + return cdp.spectrometer_frq[id] def get_frequencies(units='Hz'):