Author: bugman Date: Fri Jan 31 10:55:20 2014 New Revision: 22090 URL: http://svn.gna.org/viewcvs/relax?rev=22090&view=rev Log: Better support for replicated spectra in the NOE analysis. The saturated and reference peak intensity and error are now properly averaged. Previously averaging was not used as the number of replicates N are cancelled in the ratios used for the NOE and error calculation. However this fails when the number of replicates for the saturated spectrum does not match the number of replicates for the reference spectrum. Now any data combination is possible. Modified: trunk/specific_analyses/noe/main.py Modified: trunk/specific_analyses/noe/main.py URL: http://svn.gna.org/viewcvs/relax/trunk/specific_analyses/noe/main.py?rev=22090&r1=22089&r2=22090&view=diff ============================================================================== --- trunk/specific_analyses/noe/main.py (original) +++ trunk/specific_analyses/noe/main.py Fri Jan 31 10:55:20 2014 @@ -121,18 +121,28 @@ # Average intensities (if required). sat = 0.0 sat_err = 0.0 + sat_count = 0 ref = 0.0 ref_err = 0.0 + ref_count = 0 for id in cdp.spectrum_ids: # Sat spectra. if cdp.spectrum_type[id] == 'sat': - sat = sat + spin.intensities[id] - sat_err = sat_err + spin.intensity_err[id] + sat += spin.intensities[id] + sat_err += spin.intensity_err[id] + sat_count += 1 # Ref spectra. if cdp.spectrum_type[id] == 'ref': - ref = ref + spin.intensities[id] - ref_err = ref_err + spin.intensity_err[id] + ref += spin.intensities[id] + ref_err += spin.intensity_err[id] + ref_count += 1 + + # Average the values. + sat = sat / sat_count + sat_err = sat_err / sat_count + ref = ref / ref_count + ref_err = ref_err / ref_count # Calculate the NOE. spin.noe = sat / ref