Author: tlinnet
Date: Fri Dec 5 17:38:51 2014
New Revision: 26965
URL: http://svn.gna.org/viewcvs/relax?rev=26965&view=rev
Log:
Added the function pipe_control.error_analysis_per_field(), as an automatic way
of submitting subset ids per field for error analysis.
Modified:
trunk/pipe_control/spectrum.py
Modified: trunk/pipe_control/spectrum.py
URL:
http://svn.gna.org/viewcvs/relax/trunk/pipe_control/spectrum.py?rev=26965&r1=26964&r2=26965&view=diff
==============================================================================
--- trunk/pipe_control/spectrum.py (original)
+++ trunk/pipe_control/spectrum.py Fri Dec 5 17:38:51 2014
@@ -33,6 +33,7 @@
# relax module imports.
from lib.errors import RelaxError, RelaxImplementError, RelaxNoSpectraError
from lib.io import write_data
+from lib.text.sectioning import section
from lib.spectrum.peak_list import read_peak_list
from lib.statistics import std
from lib.warnings import RelaxWarning, RelaxNoSpinWarning
@@ -435,6 +436,54 @@
# Set the errors.
__errors_vol_no_repl()
+
+
+def error_analysis_per_field():
+ """Perform an error analysis of the peak intensities for each field
strength separately."""
+
+ # Printout.
+ section(file=sys.stdout, text="Automatic Error analysis per field
strength", prespace=2)
+
+ # Check if intensity errors have already been calculated by the user.
+ precalc = True
+ for spin in spin_loop(skip_desel=True):
+ # No structure.
+ if not hasattr(spin, 'peak_intensity_err'):
+ precalc = False
+ break
+
+ # Determine if a spectrum ID is missing from the list.
+ for id in cdp.spectrum_ids:
+ if id not in spin.peak_intensity_err:
+ precalc = False
+ break
+
+ # Skip.
+ if precalc:
+ print("Skipping the error analysis as it has already been performed.")
+ return
+
+ # Handle missing frequency data.
+ frqs = [None]
+ if hasattr(cdp, 'spectrometer_frq_list'):
+ frqs = cdp.spectrometer_frq_list
+
+ # Loop over the spectrometer frequencies.
+ for frq in frqs:
+ # Generate a list of spectrum IDs matching the frequency.
+ ids = []
+ for id in cdp.spectrum_ids:
+ # Check that the spectrometer frequency matches.
+ match_frq = True
+ if frq != None and cdp.spectrometer_frq[id] != frq:
+ match_frq = False
+
+ # Add the ID.
+ if match_frq:
+ ids.append(id)
+
+ # Run the error analysis on the subset.
+ error_analysis(subset=ids)
def get_ids():
_______________________________________________
relax (http://www.nmr-relax.com)
This is the relax-commits mailing list
[email protected]
To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-commits