mailr7093 - /branches/rdc_analysis/generic_fns/pcs.py


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

Header


Content

Posted by edward on August 08, 2008 - 06:12:
Author: bugman
Date: Thu Aug  7 19:53:50 2008
New Revision: 7093

URL: http://svn.gna.org/viewcvs/relax?rev=7093&view=rev
Log:
Removed some more useless functions.


Modified:
    branches/rdc_analysis/generic_fns/pcs.py

Modified: branches/rdc_analysis/generic_fns/pcs.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/rdc_analysis/generic_fns/pcs.py?rev=7093&r1=7092&r2=7093&view=diff
==============================================================================
--- branches/rdc_analysis/generic_fns/pcs.py (original)
+++ branches/rdc_analysis/generic_fns/pcs.py Thu Aug  7 19:53:50 2008
@@ -713,184 +713,6 @@
     return value, error
 
 
-def update_data_structures_pipe(ri_label=None, frq_label=None, frq=None):
-    """Function for updating all relaxation data structures in the current 
data pipe.
-
-    @param ri_label:        The relaxation data type, ie 'R1', 'R2', or 
'NOE'.
-    @type ri_label:         str
-    @param frq_label:       The field strength label.
-    @type frq_label:        str
-    @param frq:             The spectrometer proton frequency in Hz.
-    @type frq:              float
-    """
-
-    # Alias the current data pipe.
-    cdp = ds[ds.current_pipe]
-
-    # Initialise the relaxation data structures (if needed).
-    data_init(cdp, global_flag=True)
-
-    # The index.
-    i = len(cdp.ri_labels) - 1
-
-    # Update the number of relaxation data points.
-    cdp.num_ri = cdp.num_ri + 1
-
-    # Add ri_label to the data types.
-    cdp.ri_labels.append(ri_label)
-
-    # Find if the frequency has already been loaded.
-    remap = len(cdp.frq)
-    flag = 0
-    for j in xrange(len(cdp.frq)):
-        if frq == cdp.frq[j]:
-            remap = j
-            flag = 1
-
-    # Update the remap table.
-    cdp.remap_table.append(remap)
-
-    # Update the data structures which have a length equal to the number of 
field strengths.
-    if not flag:
-        # Update the number of frequencies.
-        cdp.num_frq = cdp.num_frq + 1
-
-        # Update the frequency labels.
-        cdp.frq_labels.append(frq_label)
-
-        # Update the frequency array.
-        cdp.frq.append(frq)
-
-    # Update the NOE R1 translation table.
-    cdp.noe_r1_table.append(None)
-
-    # If the data corresponds to 'NOE', try to find if the corresponding R1 
data.
-    if ri_label == 'NOE':
-        for j in xrange(cdp.num_ri):
-            if cdp.ri_labels[j] == 'R1' and frq_label == 
cdp.frq_labels[cdp.remap_table[j]]:
-                cdp.noe_r1_table[cdp.num_ri - 1] = j
-
-    # Update the NOE R1 translation table.
-    # If the data corresponds to 'R1', try to find if the corresponding NOE 
data.
-    if ri_label == 'R1':
-        for j in xrange(cdp.num_ri):
-            if cdp.ri_labels[j] == 'NOE' and frq_label == 
cdp.frq_labels[cdp.remap_table[j]]:
-                cdp.noe_r1_table[j] = cdp.num_ri - 1
-
-
-def update_data_structures_spin(spin=None, ri_label=None, frq_label=None, 
frq=None, value=None, error=None):
-    """Function for updating all relaxation data structures of the given 
spin container.
-
-    @param spin:            The SpinContainer object.
-    @type spin:             class instance
-    @param ri_label:        The relaxation data type, ie 'R1', 'R2', or 
'NOE'.
-    @type ri_label:         str
-    @param frq_label:       The field strength label.
-    @type frq_label:        str
-    @param frq:             The spectrometer proton frequency in Hz.
-    @type frq:              float
-    @param value:           The relaxation data value.
-    @type value:            float
-    @param error:           The relaxation data error.
-    @type error:            float
-    """
-
-    # Initialise the relaxation data structures (if needed).
-    data_init(spin, global_flag=False)
-
-    # Find the index corresponding to 'ri_label' and 'frq_label'.
-    index = find_index(spin, ri_label, frq_label)
-
-    # Append empty data.
-    if index == None:
-        spin.relax_data.append(None)
-        spin.relax_error.append(None)
-        spin.ri_labels.append(None)
-        spin.remap_table.append(None)
-        spin.noe_r1_table.append(None)
-
-    # Set the index value.
-    if index == None:
-        i = len(spin.relax_data) - 1
-    else:
-        i = index
-
-    # Relaxation data and errors.
-    spin.relax_data[i] = value
-    spin.relax_error[i] = error
-
-    # Update the number of relaxation data points.
-    if index == None:
-        spin.num_ri = spin.num_ri + 1
-
-    # Add ri_label to the data types.
-    spin.ri_labels[i] = ri_label
-
-    # Find if the frequency frq has already been loaded.
-    remap = len(spin.frq)
-    flag = 0
-    for j in xrange(len(spin.frq)):
-        if frq == spin.frq[j]:
-            remap = j
-            flag = 1
-
-    # Update the remap table.
-    spin.remap_table[i] = remap
-
-    # Update the data structures which have a length equal to the number of 
field strengths.
-    if not flag:
-        # Update the number of frequencies.
-        if index == None:
-            spin.num_frq = spin.num_frq + 1
-
-        # Update the frequency labels.
-        spin.frq_labels.append(frq_label)
-
-        # Update the frequency array.
-        spin.frq.append(frq)
-
-    # Update the NOE R1 translation table.
-    # If the data corresponds to 'NOE', try to find if the corresponding R1 
data.
-    if ri_label == 'NOE':
-        for j in xrange(spin.num_ri):
-            if spin.ri_labels[j] == 'R1' and frq_label == 
spin.frq_labels[spin.remap_table[j]]:
-                spin.noe_r1_table[spin.num_ri - 1] = j
-
-    # Update the NOE R1 translation table.
-    # If the data corresponds to 'R1', try to find if the corresponding NOE 
data.
-    if ri_label == 'R1':
-        for j in xrange(spin.num_ri):
-            if spin.ri_labels[j] == 'NOE' and frq_label == 
spin.frq_labels[spin.remap_table[j]]:
-                spin.noe_r1_table[j] = spin.num_ri - 1
-
-
-def update_noe_r1_table(cont):
-    """Update the NOE-R1 translation table.
-
-    @param cont:    Either the pipe container or spin container to update 
the structure of.
-    @type cont:     PipeContainer or SpinContainer instance
-    """
-
-    # Create an array of None for the NOE R1 translation table, if the table 
is empty.
-    if cont.noe_r1_table == []:
-        for i in xrange(cont.num_ri):
-            cont.noe_r1_table.append(None)
-
-    # Loop over the relaxation data.
-    for i in xrange(cont.num_ri):
-        # If the data corresponds to 'NOE', try to find if the corresponding 
R1 data.
-        if cont.ri_labels[i] == 'NOE':
-            for j in xrange(cont.num_ri):
-                if cont.ri_labels[j] == 'R1' and 
cont.frq_labels[cont.remap_table[i]] == cont.frq_labels[cont.remap_table[j]]:
-                    cont.noe_r1_table[i] = j
-
-        # If the data corresponds to 'R1', try to find if the corresponding 
NOE data.
-        if cont.ri_labels[i] == 'R1':
-            for j in xrange(cont.num_ri):
-                if cont.ri_labels[j] == 'NOE' and 
cont.frq_labels[cont.remap_table[i]] == cont.frq_labels[cont.remap_table[j]]:
-                    cont.noe_r1_table[j] = i
-
-
 def write(ri_label=None, frq_label=None, file=None, dir=None, force=0):
     """Function for writing relaxation data."""
 




Related Messages


Powered by MHonArc, Updated Fri Aug 08 07:20:10 2008