mailr17146 - /branches/interatomic/generic_fns/angles.py


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

Header


Content

Posted by edward on July 03, 2012 - 09:28:
Author: bugman
Date: Tue Jul  3 09:28:28 2012
New Revision: 17146

URL: http://svn.gna.org/viewcvs/relax?rev=17146&view=rev
Log:
Converted generic_fns.angles.spheroid_frame() to the interatomic data design.


Modified:
    branches/interatomic/generic_fns/angles.py

Modified: branches/interatomic/generic_fns/angles.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/interatomic/generic_fns/angles.py?rev=17146&r1=17145&r2=17146&view=diff
==============================================================================
--- branches/interatomic/generic_fns/angles.py (original)
+++ branches/interatomic/generic_fns/angles.py Tue Jul  3 09:28:28 2012
@@ -1,6 +1,6 @@
 
###############################################################################
 #                                                                            
 #
-# Copyright (C) 2003-2005, 2007-2010 Edward d'Auvergne                       
 #
+# Copyright (C) 2003-2012 Edward d'Auvergne                                  
 #
 #                                                                            
 #
 # This file is part of the program relax.                                    
 #
 #                                                                            
 #
@@ -30,6 +30,7 @@
 
 # relax module imports.
 from generic_fns import pipes
+from generic_fns.interatomic import interatomic_loop
 from generic_fns.mol_res_spin import exists_mol_res_spin_data, 
generate_spin_id, spin_loop
 from relax_errors import RelaxError, RelaxNoPdbError, RelaxNoSequenceError, 
RelaxNoTensorError
 from relax_warnings import RelaxWarning
@@ -150,21 +151,18 @@
 def spheroid_frame():
     """Function for calculating the angle alpha of the XH vector within the 
spheroid frame."""
 
-    # Loop over the sequence.
-    for spin, mol_name, res_num, res_name in spin_loop(full_info=True):
+    # Loop over the interatomic info.
+    for interatom in interatomic_loop():
         # Test if the vector exists.
-        if not hasattr(spin, 'xh_vect'):
-            # Get the spin id string.
-            spin_id = generate_spin_id(mol_name, res_num, res_name, 
spin.num, spin.name)
-
+        if not hasattr(interatom, 'vector'):
             # Throw a warning.
-            warn(RelaxWarning("No angles could be calculated for the spin " 
+ repr(spin_id) + "."))
-
-            # Skip the spin.
+            warn(RelaxWarning("No angles could be calculated for the spin 
pair '%s' and '%s'." % (interatom.spin_id1, interatom.spin_id2)))
+
+            # Skip the container.
             continue
 
         # Calculate alpha.
-        spin.alpha = acos(dot(cdp.diff_tensor.Dpar_unit, spin.xh_vect))
+        interatom.alpha = acos(dot(cdp.diff_tensor.Dpar_unit, 
interatom.vector))
 
 
 def wrap_angles(angle, lower, upper, window=2*pi):




Related Messages


Powered by MHonArc, Updated Tue Jul 03 09:40:03 2012