mailr7570 - /1.3/specific_fns/noe.py


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

Header


Content

Posted by edward on October 07, 2008 - 23:14:
Author: bugman
Date: Tue Oct  7 23:14:41 2008
New Revision: 7570

URL: http://svn.gna.org/viewcvs/relax?rev=7570&view=rev
Log:
Converted the calculate() method to the new design.


Modified:
    1.3/specific_fns/noe.py

Modified: 1.3/specific_fns/noe.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/specific_fns/noe.py?rev=7570&r1=7569&r2=7570&view=diff
==============================================================================
--- 1.3/specific_fns/noe.py (original)
+++ 1.3/specific_fns/noe.py Tue Oct  7 23:14:41 2008
@@ -59,36 +59,33 @@
             raise RelaxError, "The spectrum type '%s' is unknown." % 
spectrum_type
 
 
-    def calculate(self, run=None, verbosity=1):
-        """Function for calculating the NOE and its error.
+    def calculate(self, verbosity=1):
+        """Calculate the NOE and its error.
 
         The error for each peak is calculated using the formula::
                           ___________________________________________
                        \/ {sd(sat)*I(unsat)}^2 + {sd(unsat)*I(sat)}^2
             sd(NOE) = -----------------------------------------------
                                           I(unsat)^2
-        """
-
-        # Arguments.
-        self.run = run
+
+        @keyword verbosity: The amount of information to print.  The higher 
the value, the greater the verbosity.
+        @type verbosity:    int
+        """
 
         # Test if the current pipe exists.
         pipes.test()
 
-        # Loop over the sequence.
-        for i in xrange(len(ds.res[self.run])):
-            # Remap the data structure 'ds.res[self.run][i]'.
-            data = ds.res[self.run][i]
-
-            # Skip deselected residues.
-            if not data.select:
+        # Loop over the spins.
+        for spin in spin_loop():
+            # Skip deselected spins.
+            if not spin.select:
                 continue
 
             # Calculate the NOE.
-            data.noe = data.sat / data.ref
+            spin.noe = spin.sat / spin.ref
 
             # Calculate the error.
-            data.noe_err = sqrt((data.sat_err * data.ref)**2 + (data.ref_err 
* data.sat)**2) / data.ref**2
+            spin.noe_err = sqrt((spin.sat_err * spin.ref)**2 + (spin.ref_err 
* spin.sat)**2) / spin.ref**2
 
 
     def overfit_deselect(self):




Related Messages


Powered by MHonArc, Updated Tue Oct 07 23:20:03 2008