boinor.core.util ================ .. py:module:: boinor.core.util .. autoapi-nested-parse:: module containing auxiliary functions for the core sub-package Functions --------- .. autoapisummary:: boinor.core.util.rotation_matrix boinor.core.util.alinspace boinor.core.util.spherical_to_cartesian boinor.core.util.cartesian_to_spherical boinor.core.util.planetocentric_to_AltAz Module Contents --------------- .. py:function:: rotation_matrix(angle, axis) create 3D rotation matrix for rotation by angle around axis .. py:function:: alinspace(start, stop=None, num=50, endpoint=True) Return increasing, evenly spaced angular values over a specified interval. .. py:function:: spherical_to_cartesian(v) Compute cartesian coordinates from spherical coordinates (norm, colat, long). This function is vectorized. .. math:: v = norm \cdot \begin{bmatrix} \sin(colat)\cos(long)\\ \sin(colat)\sin(long)\\ \cos(colat)\\ \end{bmatrix} :param v: Spherical coordinates in 3D (norm, colat, long). Angles must be in radians. :type v: numpy.ndarray :returns: **v** -- Cartesian coordinates (x,y,z) :rtype: numpy.ndarray .. py:function:: cartesian_to_spherical(v) Compute spherical coordinates (norm, colat, long) from cartesian coordinates (x,y,z). This function is vectorized. The coordinates are also called (radius, inclination, azimuth). .. math:: norm = \sqrt{x^2 + y^2 + z^2} colat = \arccos{\frac{z}{norm}} lon = \arctan2(y,x) \mod 2 \pi :param v: Cartesian coordinates in 3D (x, y, z). :type v: np.array :returns: **v** -- Spherical coordinates in 3D (norm, colat, long) where norm in [0, inf), colat in [0, pi] and long in [0, 2pi). :rtype: np.array .. py:function:: planetocentric_to_AltAz(theta, phi) Defines transformation matrix to convert from Planetocentric coordinate system to the Altitude-Azimuth system. .. math:: t\_matrix = \begin{bmatrix} -\sin(theta) & \cos(theta) & 0\\ -\sin(phi)\cdot\cos(theta) & -\sin(phi)\cdot\sin(theta) & \cos(phi)\\ \cos(phi)\cdot\cos(theta) & \cos(phi)\cdot\sin(theta) & \sin(phi) \end{bmatrix} :param theta: Local sidereal time :type theta: float :param phi: Planetodetic latitude :type phi: float :returns: **t_matrix** -- Transformation matrix :rtype: numpy.ndarray