Author: bugman Date: Wed May 9 10:49:09 2012 New Revision: 16139 URL: http://svn.gna.org/viewcvs/relax?rev=16139&view=rev Log: Created the generic_fns.frq.get_values() function for returning a list of unique spectrometer frqs. Modified: branches/uf_redesign/generic_fns/frq.py Modified: branches/uf_redesign/generic_fns/frq.py URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/generic_fns/frq.py?rev=16139&r1=16138&r2=16139&view=diff ============================================================================== --- branches/uf_redesign/generic_fns/frq.py (original) +++ branches/uf_redesign/generic_fns/frq.py Wed May 9 10:49:09 2012 @@ -1,6 +1,6 @@ ############################################################################### # # -# Copyright (C) 2008-2009 Edward d'Auvergne # +# Copyright (C) 2008-2012 Edward d'Auvergne # # # # This file is part of the program relax. # # # @@ -28,6 +28,30 @@ from relax_errors import RelaxError +def get_values(): + """Return a list of all the current frequencies. + + @return: The frequency list for the current data pipe. + @rtype: list of float + """ + + # No frequency data. + if not hasattr(cdp, 'frq'): + return [] + + # The frequency values. + values = cdp.frq.values() + + # Build a list of the unique frequencies. + frq = [] + for value in values: + if value not in frq: + frq.append(value) + + # Return the frqs. + return frq + + def set(id=None, frq=None): """Set the spectrometer frequency of the experiment.