jaxoplanet.light_curves.transforms
==================================

.. py:module:: jaxoplanet.light_curves.transforms

.. autoapi-nested-parse::

   A module providing decorators to transform light curve functions



Functions
---------

.. autoapisummary::

   jaxoplanet.light_curves.transforms.integrate
   jaxoplanet.light_curves.transforms.interpolate


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

.. py:function:: integrate(func: jaxoplanet.light_curves.types.LightCurveFunc, exposure_time: jaxoplanet.types.Scalar | None = None, order: int = 0, num_samples: int = 7) -> jaxoplanet.light_curves.types.LightCurveFunc

   Transform a light curve function to apply exposure time integration

   This transformation applies a fixed stencil numerical integration scheme to the input
   function ``func`` to convolve the light curve with a top hat exposure time centered
   on the input time, with a full width of ``exposure_time``.

   The order of the integration scheme is set using the ``order`` parameter which must
   be ``0``, ``1``, or ``2``. The default (``0``) uses the "resampling" scheme discussed
   by `Kipping (2010) <https://arxiv.org/abs/1004.3741>`_. The higher order schemes
   ``1`` and ``2`` apply the trapezoid and Simpson's rules respectively, but won't
   necessarily provide higher accuracy results because of discontinuities at the
   contact points.

   In practice, the parameter ``num_samples`` which sets the number of function
   evaluations per integral has the most significant effect on the accuracy of this
   integral, trading off against higher computational cost.

   :param func: A light curve function which takes a time ``Scalar`` as the first
                argument
   :param exposure_time: The exposure time (in days, by default)
   :type exposure_time: Scalar
   :param order: The order of the integration scheme as discussed above
   :type order: int
   :param num_samples: The number of function evaluations made per integral,
                       controlling the accuracy of the numerics
   :type num_samples: int

   :returns: A new light curve function with the same signature as ``func``, computing the
             exposure time integrated flux


.. py:function:: interpolate(func: jaxoplanet.light_curves.types.LightCurveFunc, *, period: jaxoplanet.types.Scalar, time_transit: jaxoplanet.types.Scalar, num_samples: int, duration: jaxoplanet.types.Scalar | None = None, args: tuple[Any, Ellipsis] = (), kwargs: dict[str, Any] | None = None) -> jaxoplanet.light_curves.types.LightCurveFunc

   Transform a light curve function to pre-compute the model on a grid

   Sometimes it can be useful to precompute the light curve on a grid near a transit,
   and then interpolate those computations to the required phases when computing the
   full model. This can speed things up a lot when you have many transits, or a lot of
   out of transit data. This transform uses linear interpolation.

   .. note:: Unlike some other transforms, this function requires that any upstream
       ``*args`` and ``**kwargs`` be passed directly to the transform, rather than when
       calling the transformed function. This is necessary because the model is
       pre-computed when it is tranformed.

   :param func: A light curve function which takes a time ``Scalar`` as the first
                argument
   :param period: The period of the orbit. Used to wrap the input times into the
                  domain of the pre-computed model
   :type period: Scalar
   :param time_transit: The transit time of the orbit. Used to wrap the input
                        times into the domain of the pre-computed model
   :type time_transit: Scalar
   :param duration: The duration centered on the transit to pre-compute. By
                    default, the full period will be evaluated
   :type duration: Scalar
   :param num_samples: The number of points in the time grid used for pre-computation
   :type num_samples: int
   :param args: Any extra positional arguments that should be passed to ``func``
   :type args: tuple
   :param kwargs: Any extra keyword arguments that should be passed to ``func``
   :type kwargs: dict

   :returns: A new light curve function with the same signature as ``func``, computing the
             flux by interpolating a pre-computed model


