jaxoplanet.orbits.ttv
=====================

.. py:module:: jaxoplanet.orbits.ttv


Classes
-------

.. autoapisummary::

   jaxoplanet.orbits.ttv.TTVOrbit


Functions
---------

.. autoapisummary::

   jaxoplanet.orbits.ttv.compute_expected_transit_times


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

.. py:class:: TTVOrbit(*, period: jaxoplanet.types.Scalar | None = None, duration: jaxoplanet.types.Scalar | None = None, speed: jaxoplanet.types.Scalar | None = None, time_transit: jaxoplanet.types.Scalar | None = None, impact_param: jaxoplanet.types.Scalar | None = None, radius_ratio: jaxoplanet.types.Scalar | None = None, transit_times: tuple[jax.numpy.ndarray, Ellipsis] = None, transit_inds: tuple[jax.numpy.ndarray, Ellipsis] | None = None, ttvs: tuple[jaxoplanet.types.Scalar, Ellipsis] | None = None, delta_log_period: float | None = None)

   Bases: :py:obj:`jaxoplanet.orbits.TransitOrbit`


   An extension of TransitOrbit that allows for transit timing variations (TTVs).

   The TTVs can be specified in one of two ways:

   - Provide a tuple (or list) of TTV offset arrays via the argument `ttvs`.
   - Provide a tuple (or list) of observed transit time arrays via `transit_times`
       (optionally with `transit_inds` to label each transit). In this case
       a least-squares linear fit is performed to infer a reference transit time (t₀)
       and period; the residuals define the TTVs.

   Only one of these two options should be provided.

   args added on to TransitOrbit:

   - ttvs: tuple (or list) of Scalar arrays, each giving the “observed minus
       computed” transit time offsets (in days) for one planet.
   - transit_times: tuple (or list) of Scalar arrays giving the observed transit times
        (in days).
   - transit_inds: tuple (or list) of integer arrays (one per planet) labeling the
       transit numbers.
   - delta_log_period: (optional) if using transit_times and the effective transit
       period is to be slightly different from the period that governs the transit
       shape, this parameter gives the offset in natural log.



   .. py:attribute:: transit_times
      :type:  tuple[jax.numpy.ndarray, Ellipsis]


   .. py:attribute:: transit_inds
      :type:  tuple[jax.numpy.ndarray, Ellipsis]


   .. py:attribute:: ttvs
      :type:  tuple[jax.numpy.ndarray, Ellipsis]


   .. py:attribute:: t0
      :type:  jax.numpy.ndarray


   .. py:attribute:: ttv_period
      :type:  jax.numpy.ndarray


   .. py:method:: relative_position(t: jaxoplanet.types.Scalar, parallax: jaxoplanet.types.Scalar | None = None) -> tuple[jaxoplanet.types.Scalar, jaxoplanet.types.Scalar, jaxoplanet.types.Scalar]

      Compute relative position of the planet(s).



   .. py:property:: linear_t0

      Return the linear reference transit time.


   .. py:property:: linear_period

      Return the linear period.


.. py:function:: compute_expected_transit_times(min_time, max_time, period, t0)

   Compute expected transit times for each planet and return them as a tuple of 1D
   arrays.

   :param min_time: Start time (in days).
   :type min_time: float
   :param max_time: End time (in days).
   :type max_time: float
   :param period: Orbital period for each planet (in days). Should be
                  convertible to a 1D JAX array.
   :type period: array-like
   :param t0: Reference transit times for each planet (in days). Should be
              convertible to a 1D JAX array.
   :type t0: array-like

   :returns: tuple of JAX arrays, one per planet.
   :rtype: transit_times


