mailr10953 - /1.3/generic_fns/structure/geometric.py


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

Header


Content

Posted by edward on March 09, 2010 - 11:50:
Author: bugman
Date: Tue Mar  9 11:50:48 2010
New Revision: 10953

URL: http://svn.gna.org/viewcvs/relax?rev=10953&view=rev
Log:
The cone_edge() method now calls a function to obtain the maximum polar angle.

The cone_edge() arg 'angle' has been changed to 'phi_max_fn'.


Modified:
    1.3/generic_fns/structure/geometric.py

Modified: 1.3/generic_fns/structure/geometric.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/generic_fns/structure/geometric.py?rev=10953&r1=10952&r2=10953&view=diff
==============================================================================
--- 1.3/generic_fns/structure/geometric.py (original)
+++ 1.3/generic_fns/structure/geometric.py Tue Mar  9 11:50:48 2010
@@ -58,7 +58,7 @@
     return 1.8e-6
 
 
-def cone_edge(mol=None, res_name='CON', res_num=None, apex=None, axis=None, 
R=None, angle=None, length=None, inc=None):
+def cone_edge(mol=None, res_name='CON', res_num=None, apex=None, axis=None, 
R=None, phi_max_fn=None, length=None, inc=None):
     """Add a residue to the atomic data representing a cone of the given 
angle.
 
     A series of vectors totalling the number of increments and starting at 
the origin are equally
@@ -80,8 +80,8 @@
     @keyword R:             A 3x3 rotation matrix.  If the axis arg 
supplied, then this matrix will
                             be ignored.
     @type R:                3x3 numpy array
-    @keyword angle:         The cone angle in radians.
-    @type angle:            float
+    @keyword phi_max_fn:    A function which returns the maximum polar angle 
for the given azimuthal angle.
+    @type phi_max_fn:       function
     @keyword length:        The cone length in meters.
     @type length:           float
     @keyword inc:           The number of increments or number of vectors 
used to generate the outer
@@ -112,14 +112,17 @@
         # The azimuthal angle theta.
         theta = 2.0 * pi * float(i) / float(inc)
 
+        # Get the polar angle.
+        phi = phi_max_fn(theta)
+
         # X coordinate.
-        x = cos(theta) * sin(angle)
+        x = cos(theta) * sin(phi)
 
         # Y coordinate.
-        y = sin(theta)* sin(angle)
+        y = sin(theta)* sin(phi)
 
         # Z coordinate.
-        z = cos(angle)
+        z = cos(phi)
 
         # The vector in the unrotated frame.
         vector = array([x, y, z], float64)




Related Messages


Powered by MHonArc, Updated Tue Mar 09 12:00:02 2010