Author: bugman
Date: Fri Nov 7 09:08:23 2014
New Revision: 26433
URL: http://svn.gna.org/viewcvs/relax?rev=26433&view=rev
Log:
Simplifications for the inside_*() methods of the frame order matrix element
simulation script.
The limit() method is now called only once outside of these methods and the
maximum cone half-angles
passed into the inside_*() methods. Although only slightly faster, this is
mainly to simplify the
code.
Modified:
branches/frame_order_cleanup/test_suite/shared_data/frame_order/sim_vs_pred_matrix/frame_order_simulate.py
Modified:
branches/frame_order_cleanup/test_suite/shared_data/frame_order/sim_vs_pred_matrix/frame_order_simulate.py
URL:
http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/test_suite/shared_data/frame_order/sim_vs_pred_matrix/frame_order_simulate.py?rev=26433&r1=26432&r2=26433&view=diff
==============================================================================
---
branches/frame_order_cleanup/test_suite/shared_data/frame_order/sim_vs_pred_matrix/frame_order_simulate.py
(original)
+++
branches/frame_order_cleanup/test_suite/shared_data/frame_order/sim_vs_pred_matrix/frame_order_simulate.py
Fri Nov 7 09:08:23 2014
@@ -128,8 +128,12 @@
# Loop over the angle incs.
for i in range(INC):
+ # The new limits.
+ max_theta_x, max_theta_y, max_theta_z = self.limits(i)
+
# Inside the cone.
- if not self.full[i] and self.inside(i, theta, phi, sigma):
+ if not self.full[i] and self.inside(i=i, theta=theta, phi=phi,
sigma=sigma, max_theta_x=max_theta_x, max_theta_y=max_theta_y,
max_theta_z=max_theta_z):
+
# Sum of rotations and cross products.
self.first_frame_order[i] += self.rot
self.second_frame_order[i] += Rx2
@@ -180,58 +184,49 @@
self.z_axis = array([0, 0, 1], float64)
- def inside_pseudo_ellipse(self, i, theta, phi, sigma):
+ def inside_pseudo_ellipse(self, i=None, theta=None, phi=None, sigma=None,
max_theta_x=None, max_theta_y=None, max_theta_z=None):
"""Determine if the frame is inside the limits."""
- # The new limits.
- theta_x, theta_y, theta_z = self.limits(i)
-
# Check for a torsion angle violation.
- if sigma < -theta_z or sigma > theta_z:
+ if sigma < -max_theta_z or sigma > max_theta_z:
return False
# Check for a tilt angle violation.
- theta_max = 1.0 / sqrt(cos(phi)**2 / theta_x**2 + sin(phi)**2 /
theta_y**2)
- if theta > theta_max:
+ max_theta = 1.0 / sqrt(cos(phi)**2 / max_theta_x**2 + sin(phi)**2 /
max_theta_y**2)
+ if theta > max_theta:
return False
# Inside.
return True
- def inside_free_rotor(self, i, theta, phi, sigma):
+ def inside_free_rotor(self, i=None, theta=None, phi=None, sigma=None,
max_theta_x=None, max_theta_y=None, max_theta_z=None):
"""Determine if the frame is inside the limits, which for the free
rotor is always true."""
# Inside.
return True
- def inside_iso_cone(self, i, theta, phi, sigma):
+ def inside_iso_cone(self, i=None, theta=None, phi=None, sigma=None,
max_theta_x=None, max_theta_y=None, max_theta_z=None):
"""Determine if the frame is inside the limits."""
- # The new limits.
- theta_x, theta_y, theta_z = self.limits(i)
-
# Check for a torsion angle violation.
- if sigma < -theta_z or sigma > theta_z:
+ if sigma < -max_theta_z or sigma > max_theta_z:
return False
# Check for a tilt angle violation.
- if theta > theta_x:
+ if theta > max_theta_x:
return False
# Inside.
return True
- def inside_rotor(self, i, theta, phi, sigma):
+ def inside_rotor(self, i=None, theta=None, phi=None, sigma=None,
max_theta_x=None, max_theta_y=None, max_theta_z=None):
"""Determine if the frame is inside the limits."""
- # The new limits.
- theta_x, theta_y, theta_z = self.limits(i)
-
# Check for a torsion angle violation.
- if sigma < -theta_z or sigma > theta_z:
+ if sigma < -max_theta_z or sigma > max_theta_z:
return False
# Inside.
_______________________________________________
relax (http://www.nmr-relax.com)
This is the relax-commits mailing list
[email protected]
To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-commits