s2fft_rotation
==============

.. py:module:: s2fft_rotation

.. autoapi-nested-parse::

   Some of the code in this submodule is taken directly from the MIT-licensed
   's2fft' package. Below is the original license text:

   Copyright (c) 2022 Authors & Contributors

   Permission is hereby granted, free of charge, to any person obtaining a copy
   of this software and associated documentation files (the "Software"), to deal
   in the Software without restriction, including without limitation the rights
   to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
   copies of the Software, and to permit persons to whom the Software is
   furnished to do so, subject to the following conditions:

   The above copyright notice and this permission notice shall be included in all
   copies or substantial portions of the Software.

   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
   IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
   AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
   LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
   OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
   SOFTWARE.



Functions
---------

.. autoapisummary::

   s2fft_rotation.compute_rotation_matrices
   s2fft_rotation.rotate_flms


Module Contents
---------------

.. py:function:: compute_rotation_matrices(deg, x, y, z, theta, homogeneous=False)

.. py:function:: rotate_flms(flm: jax.numpy.ndarray, L: int, rotation: tuple[float, float, float], dl_array: jax.numpy.ndarray = None) -> jax.numpy.ndarray

   Rotates an array of spherical harmonic coefficients by angle rotation.

   :param flm: Array of spherical harmonic coefficients.
   :type flm: jnp.ndarray
   :param L: Harmonic band-limit.
   :type L: int
   :param rotation: Rotation on the sphere
                    (alpha, beta, gamma).
   :type rotation: Tuple[float, float, float]
   :param dl_array: Precomputed array of reduced Wigner d-function
                    coefficients, see :func:~`generate_rotate_dls`. Defaults to None.
   :type dl_array: jnp.ndarray, optional

   :returns: Rotated spherical harmonic coefficients with shape [L,2L-1].
   :rtype: jnp.ndarray


