Author: bugman Date: Wed Feb 2 16:47:02 2011 New Revision: 12506 URL: http://svn.gna.org/viewcvs/relax?rev=12506&view=rev Log: Created the BMRB list_sample_conditions() function to return a list of sample condition names. Modified: branches/bmrb/generic_fns/bmrb.py Modified: branches/bmrb/generic_fns/bmrb.py URL: http://svn.gna.org/viewcvs/relax/branches/bmrb/generic_fns/bmrb.py?rev=12506&r1=12505&r2=12506&view=diff ============================================================================== --- branches/bmrb/generic_fns/bmrb.py (original) +++ branches/bmrb/generic_fns/bmrb.py Wed Feb 2 16:47:02 2011 @@ -120,6 +120,27 @@ create_spin(spin_num=spin_nums[i], spin_name=spin_names[i], res_num=res_nums[i], res_name=res_names[i], mol_name=mol_names[i]) +def list_sample_conditions(star): + """Get a listing of all the sample conditions. + + @param star: The NMR-STAR dictionary object. + @type star: NMR_STAR instance + @return: The list of sample condition names. + @rtype: list of str + """ + + # Init. + sample_conds = [] + + # Get the sample conditions. + for data in star.sample_conditions.loop(): + # Store the framecode. + sample_conds.append(data['sf_framecode']) + + # Return the names. + return sample_conds + + def molecule_names(data, N=0): """Generate the molecule names list.