mailr2687 - /branches/tensor_pdb/generic_fns/pdb.py


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

Header


Content

Posted by edward . dauvergne on October 29, 2006 - 04:06:
Author: bugman
Date: Sun Oct 29 04:05:44 2006
New Revision: 2687

URL: http://svn.gna.org/viewcvs/relax?rev=2687&view=rev
Log:
Modification to the uniform distribution of vectors.

The vectors of the radial array (longitude) have been shifted by half an 
increment and the last
vector, which has moved beyond the pole, has been dropped.  In addition, 
vectors have been added to
the top and bottom poles, slightly breaking the uniformity of the 
distribution.  This improves
the appearance of the PDB geometric object representing the diffusion tensor.


Modified:
    branches/tensor_pdb/generic_fns/pdb.py

Modified: branches/tensor_pdb/generic_fns/pdb.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/tensor_pdb/generic_fns/pdb.py?rev=2687&r1=2686&r2=2687&view=diff
==============================================================================
--- branches/tensor_pdb/generic_fns/pdb.py (original)
+++ branches/tensor_pdb/generic_fns/pdb.py Sun Oct 29 04:05:44 2006
@@ -295,7 +295,7 @@
         # Loop over the radial array of vectors (loop over the azimauthal 
angle distribution of theta).
         for i in range(inc):
             # Loop over the vectors of the radial array (loop over the polar 
angle distribution of phi).
-            for j in range(inc/2+1):
+            for j in range(inc/2+2):
                 # Index.
                 index = i + j*inc
 
@@ -712,17 +712,17 @@
             u[i] = float(i) * val
 
         # Generate the increment values of v.
-        v = zeros(inc/2+1, Float64)
+        v = zeros(inc/2+2, Float64)
         val = 1.0 / float(inc/2)
-        for i in xrange(inc/2+1):
-            v[i] = float(i) * val
+        for i in xrange(1, inc/2+1):
+            v[i] = float(i-1) * val + val/2.0
+        v[-1] = 1.0
 
         # Generate the distribution of spherical angles theta.
         theta = 2.0 * pi * u
 
         # Generate the distribution of spherical angles phi.
         phi = arccos(2.0 * v - 1.0)
-
 
         # Generate the distribution of vectors.
         vectors = []




Related Messages


Powered by MHonArc, Updated Sun Oct 29 04:20:05 2006