Author: bugman Date: Fri Jan 31 11:26:30 2014 New Revision: 22093 URL: http://svn.gna.org/viewcvs/relax?rev=22093&view=rev Log: Merged revisions 22090 via svnmerge from svn+ssh://bugman@xxxxxxxxxxx/svn/relax/trunk ........ r22090 | bugman | 2014-01-31 10:55:20 +0100 (Fri, 31 Jan 2014) | 9 lines 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: branches/double_rotor/ (props changed) branches/double_rotor/specific_analyses/noe/main.py Propchange: branches/double_rotor/ ------------------------------------------------------------------------------ --- svnmerge-integrated (original) +++ svnmerge-integrated Fri Jan 31 11:26:30 2014 @@ -1,1 +1,1 @@ -/trunk:1-22080,22082-22084,22088 +/trunk:1-22090 Modified: branches/double_rotor/specific_analyses/noe/main.py URL: http://svn.gna.org/viewcvs/relax/branches/double_rotor/specific_analyses/noe/main.py?rev=22093&r1=22092&r2=22093&view=diff ============================================================================== --- branches/double_rotor/specific_analyses/noe/main.py (original) +++ branches/double_rotor/specific_analyses/noe/main.py Fri Jan 31 11:26:30 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