mailr19625 - /branches/relax_disp/specific_analyses/relax_disp.py


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

Header


Content

Posted by edward on May 03, 2013 - 11:11:
Author: bugman
Date: Fri May  3 11:11:56 2013
New Revision: 19625

URL: http://svn.gna.org/viewcvs/relax?rev=19625&view=rev
Log:
Started to implement the relaxation dispersion analysis specific calculate() 
method.

This will be used to calculate the R2eff/R1rho values for the fixed 
relaxation time period data types
and is equivalent to Sebastien Morin's relax_disp.calc_r2eff user function 
deleted at r19580
(see http://thread.gmane.org/gmane.science.nmr.relax.scm/17336).


Modified:
    branches/relax_disp/specific_analyses/relax_disp.py

Modified: branches/relax_disp/specific_analyses/relax_disp.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/relax_disp/specific_analyses/relax_disp.py?rev=19625&r1=19624&r2=19625&view=diff
==============================================================================
--- branches/relax_disp/specific_analyses/relax_disp.py (original)
+++ branches/relax_disp/specific_analyses/relax_disp.py Fri May  3 11:11:56 
2013
@@ -619,7 +619,7 @@
 
         # CPMG type data.
         if cdp.exp_type in CPMG_EXP:
-            fields = unique_elements(cdp.cpmg_frqs_list.values())
+            fields = unique_elements(cdp.cpmg_frqs_list)
         elif cdp.exp_type in R1RHO_EXP:
             fields = unique_elements(cdp.spin_lock_nu1.values())
         else:
@@ -1494,6 +1494,60 @@
                 yield spin, key
 
 
+    def calculate(self, spin_id=None, verbosity=1, sim_index=None):
+        """Calculate the R2eff values for fixed relaxation time period data.
+
+        @keyword spin_id:   The spin identification string.
+        @type spin_id:      None or str
+        @keyword verbosity: The amount of information to print.  The higher 
the value, the greater the verbosity.
+        @type verbosity:    int
+        @keyword sim_index: The MC simulation index (unused).
+        @type sim_index:    None
+        """
+
+        # Test if the current pipe exists.
+        pipes.test()
+
+        # Test if sequence data is loaded.
+        if not exists_mol_res_spin_data():
+            raise RelaxNoSequenceError
+
+        # Test if the model has been set.
+        if not hasattr(cdp, 'exp_type'):
+            raise RelaxError("The relaxation dispersion experiment type has 
not been specified.")
+
+        # Test if the model has been set.
+        if not hasattr(cdp, 'model'):
+            raise RelaxError("The relaxation dispersion model has not been 
specified.")
+
+        # Test if the curve count exists.
+        if not hasattr(cdp, 'dispersion_points'):
+            if cdp.exp_type == 'cpmg':
+                raise RelaxError("The CPMG frequencies have not been set 
up.")
+            elif cdp.exp_type == 'r1rho':
+                raise RelaxError("The spin-lock field strengths have not 
been set up.")
+
+        # Only allow the fixed relaxation time period data types.
+        if cdp.exp_type not in FIXED_TIME_EXP:
+            raise RelaxError("The experiment '%s' is not of the fixed 
relaxation time period data type, the R2eff/R1rho values cannot be directly 
calculated." % cdp.exp_type)
+
+        # Loop over the spins.
+        for spin, spin_id in spin_loop(return_id=True, skip_desel=True):
+            # Skip spins which have no data.
+            if not hasattr(spin, 'intensities'):
+                continue
+
+            # Loop over each exponential curve.
+            print spin
+            for field in self._spectrometer_loop():
+                for disp_point in self._dispersion_point_loop():
+                    print field, disp_point
+
+
+
+
+
+
     def create_mc_data(self, data_id):
         """Create the Monte Carlo peak intensity data.
 




Related Messages


Powered by MHonArc, Updated Fri May 03 11:20:01 2013