skyscapes.io._frames
====================

.. py:module:: skyscapes.io._frames

.. autoapi-nested-parse::

   Frame conversions for ExoVista-style barycentric -> sky-plane rotations.

   Ports ``exoverses.util.misc.gen_rotate_to_sky_coords`` (convention
   ``"exovista"``) to JAX-friendly degrees-in-floats inputs. The math is
   identical: rotate by ``-inclination`` around X, then by ``+position_angle``
   around Z, then flip the Z sign so that the resulting frame has +Z toward
   the observer.



Functions
---------

.. autoapisummary::

   skyscapes.io._frames._rot_x
   skyscapes.io._frames._rot_z
   skyscapes.io._frames.rotate_to_sky_coords


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

.. py:function:: _rot_x(angle_rad)

   3x3 rotation matrix around the X axis.


.. py:function:: _rot_z(angle_rad)

   3x3 rotation matrix around the Z axis.


.. py:function:: rotate_to_sky_coords(vectors, inc_deg, pa_deg)

   Rotate ``Nx3`` barycentric vectors into the sky frame.

   Matches ``exoverses.util.misc.gen_rotate_to_sky_coords`` with
   ``convention="exovista"``:

   1. Rotate by ``-inc_deg`` around the X axis.
   2. Rotate by ``+pa_deg`` around the Z axis.
   3. Flip the Z component sign.

   Args:
       vectors: ``(N, 3)`` array of barycentric position or velocity
           vectors.
       inc_deg: System midplane inclination in degrees.
       pa_deg: System midplane position angle in degrees.

   Returns:
       ``(N, 3)`` array of vectors expressed in the sky frame.


