Package lib :: Package geometry :: Module angles
[hide private]
[frames] | no frames]

Module angles

source code

Module for the manipulation of angular information.

Functions [hide private]
float
fold_spherical_angles(theta, phi, theta_lower=0, theta_upper=6.28318530718, theta_window=6.28318530718, phi_lower=0, phi_upper=6.28318530718, phi_window=6.28318530718)
Fold the spherical angles taking symmetry into account.
source code
float
wrap_angles(angle, lower, upper, window=6.28318530718)
Convert the given angle to be between the lower and upper values.
source code
Variables [hide private]
  __package__ = 'lib.geometry'

Imports: pi, RelaxError


Function Details [hide private]

fold_spherical_angles(theta, phi, theta_lower=0, theta_upper=6.28318530718, theta_window=6.28318530718, phi_lower=0, phi_upper=6.28318530718, phi_window=6.28318530718)

source code 

Fold the spherical angles taking symmetry into account.

The angles will be folded between:

   0 <= theta <= pi,
   0 <= phi <= 2*pi,
Parameters:
  • theta (float) - The azimuthal angle.
  • phi (float) - The polar angle.
  • theta_lower (float) - The theta angle lower bound (defaults to 0).
  • theta_upper (float) - The theta angle upper bound (defaults to 2*pi).
  • theta_window (float) - The size of the theta angle window where symmetry exists (defaults to 2*pi).
  • phi_lower (float) - The phi angle lower bound (defaults to 0).
  • phi_upper (float) - The phi angle upper bound (defaults to 2*pi).
  • phi_window (float) - The size of the phi angle window where symmetry exists (defaults to 2*pi).
Returns: float
The folded angles, theta and phi.

wrap_angles(angle, lower, upper, window=6.28318530718)

source code 

Convert the given angle to be between the lower and upper values.

Parameters:
  • angle (float) - The starting angle.
  • lower (float) - The lower bound.
  • upper (float) - The upper bound.
  • window (float) - The size of the window where symmetry exists (defaults to 2pi).
Returns: float
The wrapped angle.