Author: bugman Date: Tue Mar 9 13:14:32 2010 New Revision: 10955 URL: http://svn.gna.org/viewcvs/relax?rev=10955&view=rev Log: Added a new cone type in the Pseudo_elliptic class. Modified: 1.3/generic_fns/structure/cones.py Modified: 1.3/generic_fns/structure/cones.py URL: http://svn.gna.org/viewcvs/relax/1.3/generic_fns/structure/cones.py?rev=10955&r1=10954&r2=10955&view=diff ============================================================================== --- 1.3/generic_fns/structure/cones.py (original) +++ 1.3/generic_fns/structure/cones.py Tue Mar 9 13:14:32 2010 @@ -22,6 +22,9 @@ # Module docstring. """Module containing all the different cone type classes.""" + +# Python module imports. +from math import cos, sqrt, sin class Iso_cone: @@ -49,3 +52,43 @@ # The polar angle is fixed! return self._angle + + +class Pseudo_elliptic: + """The class for the pseudo-elliptic cone. + + This is not an elliptic cone! The pseudo-ellipse is defined by:: + + phi_max^2 = phi_x^2 * cos(theta)^2 + phi_y^2 * sin(theta)^2, + + where phi_max is the maximum polar angle for the given azimuthal angle theta, phi_x is the maximum cone angle along the x-eigenvector, and phi_y is that of the y-eigenvector. The cone axis is assumed to be the z-axis. + """ + + def __init__(self, phi_x, phi_y): + """Set up the cone object. + + @param phi_x: The maximum cone angle along the x-eigenvector. + @type phi_x: float + @param phi_y: The maximum cone angle along the y-eigenvector. + @type phi_y: float + """ + + # Store the cone limits. + self._phi_x = phi_x + self._phi_y = phi_y + + + def phi_max(self, theta): + """Return the maximum polar angle phi for the given azimuthal angle theta. + + @param theta: The azimuthal angle. + @type theta: float + @return: The maximum polar angle phi for the value of theta. + @rtype: float + """ + + # Determine phi_max. + phi_max = sqrt((self._phi_x * cos(theta))**2 + (self._phi_y * sin(theta))**2) + + # Return the limit. + return phi_max