Author: bugman Date: Tue Apr 27 18:51:21 2010 New Revision: 11159 URL: http://svn.gna.org/viewcvs/relax?rev=11159&view=rev Log: Modified the RDC and PCS read() function to not add align_id to the cdp structures if no data is present. Modified: 1.3/generic_fns/pcs.py 1.3/generic_fns/rdc.py Modified: 1.3/generic_fns/pcs.py URL: http://svn.gna.org/viewcvs/relax/1.3/generic_fns/pcs.py?rev=11159&r1=11158&r2=11159&view=diff ============================================================================== --- 1.3/generic_fns/pcs.py (original) +++ 1.3/generic_fns/pcs.py Tue Apr 27 18:51:21 2010 @@ -253,7 +253,9 @@ ##################### # Loop over the PCS data. - print(("\n%-50s %-15s %-15s" % ("spin_id", "value", "error"))) + spin_ids = [] + values = [] + errors = [] for data in read_spin_data(file=file, dir=dir, file_data=file_data, spin_id_col=spin_id_col, mol_name_col=mol_name_col, res_num_col=res_num_col, res_name_col=res_name_col, spin_num_col=spin_num_col, spin_name_col=spin_name_col, data_col=data_col, error_col=error_col, sep=sep, spin_id=spin_id): # Unpack. if data_col and error_col: @@ -292,12 +294,21 @@ # Append the error. spin.pcs_err[align_id] = error - # Print out. - print(("%-50s %15s %15s" % (id, value, error))) + # Append the data for print out. + spin_ids.append(id) + values.append(value) + errors.append(error) + + # Print out. + write_spin_data(file=sys.stdout, spin_ids=spin_ids, data=values, data_name='RDCs', error=errors, error_name='RDC_error') # Global (non-spin specific) data. ################################## + + # No data, so return. + if not len(values): + return # Initialise. if not hasattr(cdp, 'align_ids'): Modified: 1.3/generic_fns/rdc.py URL: http://svn.gna.org/viewcvs/relax/1.3/generic_fns/rdc.py?rev=11159&r1=11158&r2=11159&view=diff ============================================================================== --- 1.3/generic_fns/rdc.py (original) +++ 1.3/generic_fns/rdc.py Tue Apr 27 18:51:21 2010 @@ -303,6 +303,10 @@ # Global (non-spin specific) data. ################################## + # No data, so return. + if not len(values): + return + # Initialise. if not hasattr(cdp, 'align_ids'): cdp.align_ids = []