mailr12656 - /branches/relax_data/generic_fns/relax_data.py


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

Header


Content

Posted by edward on March 01, 2011 - 17:32:
Author: bugman
Date: Tue Mar  1 17:32:03 2011
New Revision: 12656

URL: http://svn.gna.org/viewcvs/relax?rev=12656&view=rev
Log:
Deleted the now useless add_data_to_spin() function.


Modified:
    branches/relax_data/generic_fns/relax_data.py

Modified: branches/relax_data/generic_fns/relax_data.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/relax_data/generic_fns/relax_data.py?rev=12656&r1=12655&r2=12656&view=diff
==============================================================================
--- branches/relax_data/generic_fns/relax_data.py (original)
+++ branches/relax_data/generic_fns/relax_data.py Tue Mar  1 17:32:03 2011
@@ -42,127 +42,6 @@
 from relax_io import read_spin_data
 from relax_warnings import RelaxWarning
 import specific_fns
-
-
-def add_data_to_spin(spin=None, ri_labels=None, remap_table=None, 
frq_labels=None, frq=None, values=None, errors=None, sim=False):
-    """Add the relaxation data to the spin.
-
-    @keyword spin:          The spin container.
-    @type spin:             SpinContainer instance
-    @keyword ri_labels:     The labels corresponding to the data type, eg 
['NOE', 'R1', 'R2',
-                            'NOE', 'R1', 'R2'].
-    @type ri_labels:        list of str
-    @keyword remap_table:   A translation table to map relaxation data 
points to their
-                            frequencies, eg [0, 0, 0, 1, 1, 1].
-    @type remap_table:      list of int
-    @keyword frq_labels:    NMR frequency labels, eg ['600', '500'].
-    @type frq_labels:       list of str
-    @keyword frq:           NMR frequencies in Hz, eg [600.0 * 1e6, 500.0 * 
1e6].
-    @type frq:              list of float
-    @keyword values:        The relaxation data.
-    @type values:           list of float
-    @keyword errors:        The relaxation errors.
-    @type errors:           list of float
-    @keyword sim:           A flag which if True means the data corresponds 
to Monte Carlo
-                            simulation data.
-    @type sim:              bool
-    """
-
-    # Test if the current data pipe exists.
-    pipes.test()
-
-    # Test if sequence data exists.
-    if not exists_mol_res_spin_data():
-        raise RelaxNoSequenceError
-
-
-    # Global (non-spin specific) data.
-    #####################################
-
-    # Initialise the global data if necessary.
-    data_init(cdp, global_flag=True)
-
-    # Add the data structures.
-    cdp.ri_labels = deepcopy(ri_labels)
-    cdp.remap_table = deepcopy(remap_table)
-    cdp.frq_labels = deepcopy(frq_labels)
-    cdp.frq = deepcopy(frq)
-    cdp.num_ri = len(ri_labels)
-    cdp.num_frq = len(frq)
-
-    # Update the NOE R1 translation table.
-    update_noe_r1_table(cdp)
-
-
-    # Spin specific data.
-    #####################
-
-    # Relaxation data.
-    if not sim:
-        # Initialise the relaxation data structures (if needed).
-        data_init(spin, global_flag=False)
-
-        # Relaxation data and errors.
-        spin.relax_data = values
-        spin.relax_error = errors
-
-        # Associated data structures.
-        spin.ri_labels = ri_labels
-        spin.remap_table = remap_table
-
-        # Remove any data with the value None.
-        indices = []
-        for index, Ri in enumerate(spin.relax_data):
-            if Ri == None:
-                indices.append(index)
-        indices.reverse()
-        for index in indices:
-            spin.relax_data.pop(index)
-            spin.relax_error.pop(index)
-            spin.ri_labels.pop(index)
-            spin.remap_table.pop(index)
-
-        # Remove any data with error of None.
-        indices = []
-        for index, error in enumerate(spin.relax_error):
-            if error == None:
-                indices.append(index)
-        indices.reverse()
-        for index in indices:
-            spin.relax_data.pop(index)
-            spin.relax_error.pop(index)
-            spin.ri_labels.pop(index)
-            spin.remap_table.pop(index)
-
-        # Associated data structures.
-        spin.frq_labels = []
-        spin.frq = []
-        for index in spin.remap_table:
-            if not frq_labels[index] in spin.frq_labels:
-                spin.frq_labels.append(frq_labels[index])
-                spin.frq.append(frq[index])
-
-        # Counts.
-        spin.num_ri = len(spin.relax_data)
-        spin.num_frq = len(spin.frq)
-
-        # Update the NOE R1 translation table.
-        update_noe_r1_table(spin)
-
-        # Convert to None.
-        if spin.num_ri == 0:
-            spin.num_ri = None
-        if spin.num_frq == 0:
-            spin.num_frq = None
-
-    # Simulation data.
-    else:
-        # Create the data structure if necessary.
-        if not hasattr(spin, 'relax_sim_data') or not 
isinstance(spin.relax_sim_data, list):
-            spin.relax_sim_data = []
-
-        # Append the simulation's relaxation data.
-        spin.relax_sim_data.append(values)
 
 
 def back_calc(ri_label=None, frq_label=None, frq=None):




Related Messages


Powered by MHonArc, Updated Tue Mar 01 18:00:01 2011