:py:mod:`tape.analysis.structure_function.macleod_2012.calculator`
==================================================================

.. py:module:: tape.analysis.structure_function.macleod_2012.calculator


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

Classes
~~~~~~~

.. autoapisummary::

   tape.analysis.structure_function.macleod_2012.calculator.Macleod2012StructureFunctionCalculator




Attributes
~~~~~~~~~~

.. autoapisummary::

   tape.analysis.structure_function.macleod_2012.calculator.CONVERSION_TO_SIGMA


.. py:data:: CONVERSION_TO_SIGMA
   :value: 0.74

   

.. py:class:: Macleod2012StructureFunctionCalculator(lightcurves: List[tape.analysis.structure_function.sf_light_curve.StructureFunctionLightCurve], argument_container: tape.analysis.structure_function.base_argument_container.StructureFunctionArgumentContainer)


   Bases: :py:obj:`tape.analysis.structure_function.base_calculator.StructureFunctionCalculator`

   This class implements the structure function calculation described in
   MacLeod et al. 2012, 2012ApJ...753..106M [https://arxiv.org/abs/1112.0679]
   MacLeod et al. 2012, Erratum 2014ApJ...782..119M

   `SF_obs(deltaT) = 0.74 * IQR`

   Where `IQR` is the interquartile range between 25% and 75% of the sorted
   (y(t) - y(t+delta_t)) distribution.

   Note that the return value is structure function squared.

   Additional references:
   Kozlowski 2016, 2016ApJ...826..118K [https://arxiv.org/abs/1604.05858]

   .. py:method:: calculate()

      Abstract method that must be implemented by the child class.


   .. py:method:: calculate_iqr_sf2_statistic(input)

      For a given set of binned metrics (in this case delta fluxes) calculate
      the interquartile range.

      :param input: The delta flux values that correspond to a given delta time bin.
      :type input: `np.ndarray` (N,)

      :returns: Result of calculation defined in MacLeod et al. 2012, Erratum 2014ApJ...782..119M:

                `SF(dt) = 0.74 * IQR`
      :rtype: float


   .. py:method:: name_id() -> str
      :staticmethod:

      This method will return the unique name of the Structure Function
      calculation method.


   .. py:method:: expected_argument_container() -> type
      :staticmethod:

      This method will return the argument container class type (not an
      instance) that the Structure Function calculation method requires in
      order to perform it's calculations.



