Author: bugman Date: Thu Mar 3 10:22:52 2011 New Revision: 12756 URL: http://svn.gna.org/viewcvs/relax?rev=12756&view=rev Log: Created a new function called num_frq() for determining the number of frequencies. Modified: branches/relax_data/generic_fns/relax_data.py Modified: branches/relax_data/generic_fns/relax_data.py URL: http://svn.gna.org/viewcvs/relax/branches/relax_data/generic_fns/relax_data.py?rev=12756&r1=12755&r2=12756&view=diff ============================================================================== --- branches/relax_data/generic_fns/relax_data.py (original) +++ branches/relax_data/generic_fns/relax_data.py Thu Mar 3 10:22:52 2011 @@ -533,6 +533,31 @@ # Return the list of names. return names + + +def num_frq(): + """Determine the number of unique frequencies. + + @return: The number of unique frequencies. + @rtype: int + """ + + # Init. + frq = [] + count = 0 + + # Loop over the Rx data. + for ri_id in cdp.ri_ids: + # New frequency. + if cdp.frq[ri_id] not in frq: + # Add the frequency. + frq.append(cdp.frq[ri_id]) + + # Increment the counter. + count += 1 + + # Return the counter. + return count def pack_data(ri_id, ri_type, frq, values, errors, spin_ids=None, mol_names=None, res_nums=None, res_names=None, spin_nums=None, spin_names=None, gen_seq=False):