mailr7959 - in /branches/spectral_errors: generic_fns/spectrum.py 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 October 23, 2008 - 18:32:
Author: bugman
Date: Thu Oct 23 18:32:08 2008
New Revision: 7959

URL: http://svn.gna.org/viewcvs/relax?rev=7959&view=rev
Log:
Destroyed assign_func() and shifted all the data storage back to 
generic_fns.spectrum.read().


Modified:
    branches/spectral_errors/generic_fns/spectrum.py
    branches/spectral_errors/specific_fns/relax_fit.py

Modified: branches/spectral_errors/generic_fns/spectrum.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/spectral_errors/generic_fns/spectrum.py?rev=7959&r1=7958&r2=7959&view=diff
==============================================================================
--- branches/spectral_errors/generic_fns/spectrum.py (original)
+++ branches/spectral_errors/generic_fns/spectrum.py Thu Oct 23 18:32:08 2008
@@ -379,6 +379,9 @@
     if not exists_mol_res_spin_data():
         raise RelaxNoSequenceError
 
+    # Get the current data pipe.
+    cdp = pipes.get_pipe()
+
     # Extract the data from the file.
     file_data = extract_data(file, dir)
 
@@ -433,6 +436,14 @@
     # Determine the proton and heteronucleus dimensions in the XEasy text 
file.
     if format == 'xeasy':
         det_dimensions(file_data=file_data, proton=proton, 
heteronuc=heteronuc, int_col=int_col)
+
+    # Add the spectrum id to the relax data store.
+    if not hasattr(cdp, 'spectrum_ids'):
+        cdp.spectrum_ids = []
+    if spectrum_id in cdp.spectrum_ids:
+        raise RelaxError, "The spectrum identification string '%s' already 
exists." % spectrum_id
+    else:
+        cdp.spectrum_ids.append(spectrum_id)
 
     # Loop over the peak intensity data.
     for i in xrange(len(file_data)):
@@ -455,5 +466,9 @@
         if not spin.select:
             continue
 
-        # Assign the data.
-        assign_func(spin=spin, intensity=intensity, 
spectrum_type=spectrum_type)
+        # Initialise.
+        if not hasattr(spin, 'intensities'):
+            spin.intensities = []
+
+        # Add the data.
+        spin.intensities.append(intensity)

Modified: branches/spectral_errors/specific_fns/relax_fit.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/spectral_errors/specific_fns/relax_fit.py?rev=7959&r1=7958&r2=7959&view=diff
==============================================================================
--- branches/spectral_errors/specific_fns/relax_fit.py (original)
+++ branches/spectral_errors/specific_fns/relax_fit.py Thu Oct 23 18:32:08 
2008
@@ -134,41 +134,6 @@
 
         # Return the scaling matrix.
         return scaling_matrix
-
-
-    def assign_function(self, spin=None, intensity=None, spectrum_type=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
-        @keyword spectrum_type: Unused argument sent in by the caller 
function.
-        @type spectrum_type:    None
-        """
-
-        # Alias the current data pipe.
-        cdp = pipes.get_pipe()
-
-        # Initialise.
-        index = None
-        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(spin.intensities):
-            spin.intensities.append([intensity])
-
-        # Duplicated spectra.
-        else:
-            spin.intensities[index].append(intensity)
 
 
     def back_calc(self, spin=None, relax_time_index=None):




Related Messages


Powered by MHonArc, Updated Thu Oct 23 19:00:04 2008