mailr13706 - /1.3/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 July 18, 2011 - 20:13:
Author: bugman
Date: Mon Jul 18 20:13:04 2011
New Revision: 13706

URL: http://svn.gna.org/viewcvs/relax?rev=13706&view=rev
Log:
Fix for the PCS back-calculation function - divide by zero is now avoided.

The PCS back-calculation function was calculating the normalised bond vector 
between the lanthanide
atom and itself.  The normalisation in this case is now avoided.


Modified:
    1.3/generic_fns/pcs.py

Modified: 1.3/generic_fns/pcs.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/generic_fns/pcs.py?rev=13706&r1=13705&r2=13706&view=diff
==============================================================================
--- 1.3/generic_fns/pcs.py (original)
+++ 1.3/generic_fns/pcs.py Mon Jul 18 20:13:04 2011
@@ -98,8 +98,9 @@
                 # The length.
                 r[c] = norm(vect[c])
 
-                # Normalise.
-                vect[c] = vect[c] / r[c]
+                # Normalise (only if the vector has length).
+                if r[c]:
+                    vect[c] = vect[c] / r[c]
 
                 # Calculate the PCS constant.
                 dj[c] = pcs_constant(cdp.temperature[id], cdp.frq[id] * 2.0 
* pi / g1H, r[c]/1e10)




Related Messages


Powered by MHonArc, Updated Mon Jul 18 20:40:02 2011