mailr21362 - in /branches/relax_disp/specific_analyses/relax_disp: checks.py disp_data.py


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

Header


Content

Posted by edward on October 31, 2013 - 12:09:
Author: bugman
Date: Thu Oct 31 12:09:53 2013
New Revision: 21362

URL: http://svn.gna.org/viewcvs/relax?rev=21362&view=rev
Log:
A number of fixes for the dispersion analysis for all the recent changes.


Modified:
    branches/relax_disp/specific_analyses/relax_disp/checks.py
    branches/relax_disp/specific_analyses/relax_disp/disp_data.py

Modified: branches/relax_disp/specific_analyses/relax_disp/checks.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/relax_disp/specific_analyses/relax_disp/checks.py?rev=21362&r1=21361&r2=21362&view=diff
==============================================================================
--- branches/relax_disp/specific_analyses/relax_disp/checks.py (original)
+++ branches/relax_disp/specific_analyses/relax_disp/checks.py Thu Oct 31 
12:09:53 2013
@@ -58,7 +58,7 @@
         raise RelaxError("The CPMG frequencies or spin-lock field strengths 
have not been set for any spectra.")
 
     # Check each spectrum ID.
-    for id in cdp.spectrum_ids:
+    for id in cdp.exp_type.keys():
         # CPMG data.
         if cdp.exp_type[id] in EXP_TYPE_LIST_CPMG:
             if id not in cdp.cpmg_frqs:
@@ -87,11 +87,14 @@
         if id not in cdp.exp_type.keys():
             raise RelaxError("The dispersion experiment type for the 
experiment ID '%s' has not been set." % id)
 
-    # Check each spectrum ID.
+    # Check that at least one spectrum ID is set.
     else:
+        found = False
         for id in cdp.spectrum_ids:
-            if id not in cdp.exp_type:
-                raise RelaxError("The relaxation dispersion experiment type 
has not been set for the '%s' spectrum." % id)
+            if id in cdp.exp_type:
+                found = True
+        if not found:
+            raise RelaxError("The relaxation dispersion experiment type has 
not been set any spectra.")
 
 
 def check_exp_type_fixed_time():
@@ -170,7 +173,7 @@
         raise RelaxError("The relaxation times have not been set for any 
spectra.")
 
     # Check each spectrum ID.
-    for id in cdp.spectrum_ids:
+    for id in cdp.exp_type.keys():
         if id not in cdp.relax_times:
             raise RelaxError("The relaxation time has not been set for the 
'%s' spectrum." % id)
 
@@ -209,7 +212,7 @@
         raise RelaxError("The spectrometer frequencies have not been set for 
any spectra.")
 
     # Check each spectrum ID.
-    for id in cdp.spectrum_ids:
+    for id in cdp.exp_type.keys():
         if id not in cdp.spectrometer_frq:
             raise RelaxError("The spectrometer frequency has not been set 
for the '%s' spectrum." % id)
 
@@ -242,7 +245,7 @@
         return times
 
     # Loop over all spectra IDs.
-    for id in cdp.spectrum_ids:
+    for id in cdp.exp_type.keys():
         # No time set.
         if id not in cdp.relax_times:
             continue

Modified: branches/relax_disp/specific_analyses/relax_disp/disp_data.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/relax_disp/specific_analyses/relax_disp/disp_data.py?rev=21362&r1=21361&r2=21362&view=diff
==============================================================================
--- branches/relax_disp/specific_analyses/relax_disp/disp_data.py (original)
+++ branches/relax_disp/specific_analyses/relax_disp/disp_data.py Thu Oct 31 
12:09:53 2013
@@ -235,7 +235,7 @@
 
     # Loop over all spectrum IDs, returning the matching ID.
     ids = []
-    for id in cdp.spectrum_ids:
+    for id in cdp.exp_type.keys():
         # The spectrometer frequency.
         frq2 = None
         if hasattr(cdp, 'spectrometer_frq'):
@@ -271,9 +271,6 @@
     @rtype:         str
     """
 
-    # Data check.
-    check_exp_type(id=id)
-
     # All data.
     if id == None:
         # Data checks.
@@ -343,7 +340,7 @@
         return False
 
     # Loop over all spectra IDs.
-    for id in cdp.spectrum_ids:
+    for id in cdp.exp_type.keys():
         if get_curve_type(id) == 'exponential':
             return True
 
@@ -363,7 +360,7 @@
         return False
 
     # Loop over all experiment types.
-    for id in cdp.spectrum_ids:
+    for id in cdp.exp_type.keys():
         if get_curve_type(id) == 'fixed time':
             return True
 
@@ -1646,7 +1643,7 @@
         raise RelaxError("The spin-lock offsets have not been set.")
 
     # Loop over all spectrum IDs.
-    for id in cdp.spectrum_ids:
+    for id in cdp.exp_type.keys():
         # The data.
         exp_type = cdp.exp_type[id]
         frq = cdp.spectrometer_frq[id]




Related Messages


Powered by MHonArc, Updated Thu Oct 31 15:40:02 2013