mailr25725 - in /branches/frame_order_cleanup/specific_analyses/frame_order: data.py geometric.py


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

Header


Content

Posted by edward on September 09, 2014 - 21:12:
Author: bugman
Date: Tue Sep  9 21:12:30 2014
New Revision: 25725

URL: http://svn.gna.org/viewcvs/relax?rev=25725&view=rev
Log:
Made the pivot point in the frame order PDB representation fail-proof.

If the pivot position was outside of the bounds [-1000, 1000], the PDB file 
creation would fail as
the record would be too long.  So now the pivot is shifted to be in these 
bounds.


Modified:
    branches/frame_order_cleanup/specific_analyses/frame_order/data.py
    branches/frame_order_cleanup/specific_analyses/frame_order/geometric.py

Modified: branches/frame_order_cleanup/specific_analyses/frame_order/data.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/specific_analyses/frame_order/data.py?rev=25725&r1=25724&r2=25725&view=diff
==============================================================================
--- branches/frame_order_cleanup/specific_analyses/frame_order/data.py  
(original)
+++ branches/frame_order_cleanup/specific_analyses/frame_order/data.py  Tue 
Sep  9 21:12:30 2014
@@ -97,7 +97,7 @@
         return cdp.domain[id]
 
 
-def generate_pivot(order=1, sim_index=None, pipe_name=None):
+def generate_pivot(order=1, sim_index=None, pipe_name=None, pdb_limit=False):
     """Create and return the given pivot.
 
     @keyword order:     The pivot number with 1 corresponding to the first 
pivot, 2 to the second, etc.
@@ -105,6 +105,9 @@
     @keyword sim_index: The optional Monte Carlo simulation index.  If 
provided, the pivot for the given simulation will be returned instead.
     @type sim_index:    None or int
     @keyword pipe_name: The data pipe 
+    @type pipe_name:    str
+    @keyword pdb_limit: A flag which if True will cause the coordinate to be 
between -1000 and 1000.
+    @type pdb_limit:    bool
     @return:            The give pivot point.
     @rtype:             numpy 3D rank-1 float64 array
     """
@@ -155,6 +158,14 @@
         else:
             pivot = array([dp.pivot_x, dp.pivot_y, dp.pivot_z], float64)
 
+    # PDB limits.
+    if pivot != None and pdb_limit:
+        for i in range(3):
+            if pivot[i] < -1000.0:
+                pivot[i] = -999.999
+            elif pivot[i] > 1000.0:
+                pivot[i] = 999.999
+
     # Return the pivot.
     return pivot
 

Modified: 
branches/frame_order_cleanup/specific_analyses/frame_order/geometric.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/specific_analyses/frame_order/geometric.py?rev=25725&r1=25724&r2=25725&view=diff
==============================================================================
--- branches/frame_order_cleanup/specific_analyses/frame_order/geometric.py   
  (original)
+++ branches/frame_order_cleanup/specific_analyses/frame_order/geometric.py   
  Tue Sep  9 21:12:30 2014
@@ -268,8 +268,8 @@
         mol = structure.get_molecule(mol_name, model=model_nums[i])
 
         # The pivot points.
-        pivot1 = generate_pivot(order=1, sim_index=sim_indices[i])
-        pivot2 = generate_pivot(order=2, sim_index=sim_indices[i])
+        pivot1 = generate_pivot(order=1, sim_index=sim_indices[i], 
pdb_limit=True)
+        pivot2 = generate_pivot(order=2, sim_index=sim_indices[i], 
pdb_limit=True)
 
         # Add the pivots for the double motion models.
         if cdp.model in [MODEL_DOUBLE_ROTOR]:




Related Messages


Powered by MHonArc, Updated Wed Sep 10 09:00:12 2014