mailr26985 - /trunk/pipe_control/spectrum.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by tlinnet on December 07, 2014 - 13:12:
Author: tlinnet
Date: Sun Dec  7 13:12:50 2014
New Revision: 26985

URL: http://svn.gna.org/viewcvs/relax?rev=26985&view=rev
Log:
Added new backend function in pipe_control.spectrum.sn_ratio_selection.

This is to select spins with a signal to noise ratio, higher or lower than 
the specified ratio.

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=26985&r1=26984&r2=26985&view=diff
==============================================================================
--- trunk/pipe_control/spectrum.py      (original)
+++ trunk/pipe_control/spectrum.py      Sun Dec  7 13:12:50 2014
@@ -1077,4 +1077,21 @@
     if verbose:
         if len(spin_ids) > 0:
             subsection(file=sys.stdout, text="For all of the S/N comparion 
test, the following spin ID's was %s"%text_sel, prespace=1, postspace=0)
-            print(spin_ids)
+            print(spin_ids)
+
+
+def sn_ratio_selection(ratio=1.0, operation='<', all_sn=False, verbose=True):
+    """Use user function select.spin on spins with signal to noise ratio 
higher or lower than ratio.  The operation determines the selection operation.
+
+    @keyword ratio:         The ratio to compare to.
+    @type ratio:            float
+    @keyword operation:     The comparison operation by which to select the 
spins.  Of the operation(sn_ratio, ratio), where operation can either be:  
'<', '<=', '>', '>=', '==', '!='.
+    @type operation:        str
+    @keyword all_sn:        A flag specifying if all the signal to noise 
ratios per spin should match the comparison operator, of if just a single 
comparison match is enough.
+    @type all_sn:           bool
+    @keyword verbose:       A flag which if True will print additional 
information out.
+    @type verbose:          bool
+    """
+
+    # Forward function.
+    sn_ratio_deselection(ratio=ratio, operation=operation, all_sn=all_sn, 
select=True, verbose=verbose)




Related Messages


Powered by MHonArc, Updated Sun Dec 07 13:20:01 2014