mailr18609 - in /trunk/generic_fns: pcs.py rdc.py


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

Header


Content

Posted by edward on March 04, 2013 - 15:00:
Author: bugman
Date: Mon Mar  4 15:00:11 2013
New Revision: 18609

URL: http://svn.gna.org/viewcvs/relax?rev=18609&view=rev
Log:
The rdc.back_calc and pcs.back_calc user functions now warn if no data was 
calculated.

This is to inform the user about problems at the place that they occur 
instead of later on with, for
example, the creation of empty data files.


Modified:
    trunk/generic_fns/pcs.py
    trunk/generic_fns/rdc.py

Modified: trunk/generic_fns/pcs.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/generic_fns/pcs.py?rev=18609&r1=18608&r2=18609&view=diff
==============================================================================
--- trunk/generic_fns/pcs.py (original)
+++ trunk/generic_fns/pcs.py Mon Mar  4 15:00:11 2013
@@ -76,6 +76,7 @@
     unit_vect = zeros((cdp.N, 3), float64)
 
     # Loop over the spins.
+    count = 0
     for spin in spin_loop():
         # Skip spins with no position.
         if not hasattr(spin, 'pos'):
@@ -112,6 +113,13 @@
 
             # Calculate the PCSs (in ppm).
             spin.pcs_bc[id] = ave_pcs_tensor(dj, vect, cdp.N, 
cdp.align_tensors[get_tensor_index(id)].A, weights=weights) * 1e6
+
+        # Increment the counter.
+        count += 1
+
+    # No PCSs calculated.
+    if not count:
+        warn(RelaxWarning("No PCSs have been back calculated, probably due 
to missing spin position information."))
 
 
 def centre(pos=None, atom_id=None, pipe=None, verbosity=1, ave_pos=False, 
force=False):

Modified: trunk/generic_fns/rdc.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/generic_fns/rdc.py?rev=18609&r1=18608&r2=18609&view=diff
==============================================================================
--- trunk/generic_fns/rdc.py (original)
+++ trunk/generic_fns/rdc.py Mon Mar  4 15:00:11 2013
@@ -77,6 +77,7 @@
     unit_vect = zeros((cdp.N, 3), float64)
 
     # Loop over the interatomic data.
+    count = 0
     for interatom in interatomic_loop():
         # Skip containers with no interatomic vectors.
         if not hasattr(interatom, 'vector'):
@@ -121,6 +122,13 @@
             # The absolute value.
             if hasattr(interatom, 'absolute_rdc') and id in 
interatom.absolute_rdc.keys() and interatom.absolute_rdc[id]:
                 interatom.rdc_bc[id] = abs(interatom.rdc_bc[id])
+
+        # Increment the counter.
+        count += 1
+
+    # No RDCs calculated.
+    if not count:
+        warn(RelaxWarning("No RDCs have been back calculated, probably due 
to missing bond vector information."))
 
 
 def check_pipe_setup(pipe=None, rdc_id=None, sequence=False, N=False, 
tensors=False, rdc=False):




Related Messages


Powered by MHonArc, Updated Mon Mar 04 15:20:02 2013