mailr6006 - /1.3/specific_fns/relax_fit.py


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

Header


Content

Posted by edward on April 25, 2008 - 11:59:
Author: bugman
Date: Fri Apr 25 11:59:06 2008
New Revision: 6006

URL: http://svn.gna.org/viewcvs/relax?rev=6006&view=rev
Log:
Updated the assign_function() method to the new relax design.


Modified:
    1.3/specific_fns/relax_fit.py

Modified: 1.3/specific_fns/relax_fit.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/specific_fns/relax_fit.py?rev=6006&r1=6005&r2=6006&view=diff
==============================================================================
--- 1.3/specific_fns/relax_fit.py (original)
+++ 1.3/specific_fns/relax_fit.py Fri Apr 25 11:59:06 2008
@@ -124,29 +124,37 @@
             i = i + 1
 
 
-    def assign_function(self, run=None, i=None, intensity=None):
-        """Function for assigning peak intensity data to either the 
reference or saturated spectra."""
-
-        # Alias the residue specific data structure.
-        data = relax_data_store.res[run][i]
+    def assign_function(self, spin=None, intensity=None):
+        """Place the peak intensity data into the spin container.
+
+        The intensity data can be either that of the reference or saturated 
spectrum.
+
+        @keyword spin:      The spin container.
+        @type spin:         SpinContainer instance
+        @keyword intensity: The intensity value.
+        @type intensity:    float
+        """
+
+        # Alias the current data pipe.
+        cdp = relax_data_store[relax_data_store.current_pipe]
 
         # Initialise.
         index = None
-        if not hasattr(data, 'intensities'):
-            data.intensities = []
-
-        # Determine if the relaxation time already exists for the residue 
(duplicated spectra).
-        for i in xrange(len(relax_data_store.relax_times[self.run])):
-            if self.relax_time == relax_data_store.relax_times[self.run][i]:
+        if not hasattr(spin, 'intensities'):
+            spin.intensities = []
+
+        # Determine if the relaxation time already exists for the spin 
(duplicated spectra).
+        for i in xrange(len(cdp.relax_times)):
+            if self.__relax_time == cdp.relax_times[i]:
                 index = i
 
         # A new relaxation time has been encountered.
-        if index >= len(data.intensities):
-            data.intensities.append([intensity])
+        if index >= len(spin.intensities):
+            spin.intensities.append([intensity])
 
         # Duplicated spectra.
         else:
-            data.intensities[index].append(intensity)
+            spin.intensities[index].append(intensity)
 
 
     def back_calc(self, run=None, index=None, relax_time_index=None):
@@ -851,6 +859,9 @@
         # Alias the current data pipe.
         cdp = relax_data_store[relax_data_store.current_pipe]
 
+        # Store the relaxation time in the class instance.
+        self.__relax_time = relax_time
+
         # Global relaxation time data structure.
         if not hasattr(cdp, 'relax_times'):
             cdp.relax_times = []




Related Messages


Powered by MHonArc, Updated Fri Apr 25 12:20:15 2008