:py:mod:`tape.analysis.structure_function.sf_light_curve`
=========================================================

.. py:module:: tape.analysis.structure_function.sf_light_curve


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

Classes
~~~~~~~

.. autoapisummary::

   tape.analysis.structure_function.sf_light_curve.StructureFunctionLightCurve




Attributes
~~~~~~~~~~

.. autoapisummary::

   tape.analysis.structure_function.sf_light_curve.MIN_OBSERVATIONS_REQUIRED_FOR_SF


.. py:data:: MIN_OBSERVATIONS_REQUIRED_FOR_SF
   :value: 3

   

.. py:class:: StructureFunctionLightCurve(times: numpy.ndarray, fluxes: numpy.ndarray, errors: numpy.ndarray)


   Bases: :py:obj:`tape.analysis.light_curve.LightCurve`

   This base class is meant to support various analysis routines and be
   extended as needed. (Hence it's location in the `analysis` package.)

   The base class ensures that the data for a single lightcurve is well formed.
   Namely that the input data is all of the same length, with NaN's removed and
   that there are enough observations to perform a given analysis.

   .. py:method:: _calculate_differences()

      Calculate the difference between all possible pairs of time and flux.
      Also calculate the sum of all possible pairs of error^2. To avoid
      duplicate values, we filter out any differences that correspond to a
      time difference less than 0.


   .. py:method:: select_difference_samples(number_of_samples: Optional[int] = None, random_generator: Optional[numpy.random.Generator] = None)

      Take a random sample of time and flux differences and the sum of squared
      errors. The samples are selected without replacement. The resulting
      sub-sample is not guaranteed to have the same order as the input
      differences.

      :param number_of_samples: Defines the number of samples to be randomly selected from the total
                                number of difference values. If not specified, take all of the
                                avaliable values
      :type number_of_samples: int, optional
      :param random_generator: A Numpy random.Generator to sample the lightcurve difference. This
                               allows for repeatable random samples to be selected. By default None.
      :type random_generator: np.random.Generator, optional

      :raises ValueError: If samples are requested than are present in the light curve raise
          ValueError.



