tape.analysis.stetsonj
======================

.. py:module:: tape.analysis.stetsonj


Attributes
----------

.. autoapisummary::

   tape.analysis.stetsonj.calc_stetson_J


Classes
-------

.. autoapisummary::

   tape.analysis.stetsonj.StetsonJ


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

.. py:class:: StetsonJ

   Bases: :py:obj:`tape.analysis.base.AnalysisFunction`


   Compute the StetsonJ statistic on data from one or several bands


   .. py:method:: cols(ens: Ensemble) -> List[str]

      Return the column names that the analysis function takes as input.

      :param ens: The ensemble object, it could be required to get column names of
                  the "special" columns like `ens._time_col` or `ens._err_col`.
      :type ens: Ensemble

      :returns: The column names to select and pass to .calculate() method.
                For example `[ens._time_col, ens._flux_col]`.
      :rtype: List[str]



   .. py:method:: meta(ens: Ensemble)

      Return the schema of the analysis function output.

      :param ens: The ensemble object.
      :type ens: Ensemble

      :returns: **pd.DataFrame or (str, dtype) tuple or {str** -- Dask meta, for example
                `pd.DataFrame(columns=['x', 'y'], dtype=float)`.
      :rtype: dtype} dictionary



   .. py:method:: on(ens: Ensemble) -> List[str]

      Return the columns to group source table by.

      :param ens: The ensemble object.
      :type ens: Ensemble

      :returns: The column names to group by. Typically, `[ens._id_col]`.
      :rtype: List[str]



   .. py:method:: __call__(flux: numpy.ndarray, err: numpy.ndarray, band: numpy.ndarray, *, band_to_calc: Union[str, Iterable[str], None] = None, check_nans: bool = False)

      Compute the StetsonJ statistic on data from one or several bands

      :param flux: Array of flux/magnitude measurements
      :type flux: `numpy.ndarray` (N,)
      :param err: Array of associated flux/magnitude errors
      :type err: `numpy.ndarray` (N,)
      :param band: Array of associated band labels
      :type band: `numpy.ndarray` (N,)
      :param band_to_calc: Bands to calculate StetsonJ on. Single band descriptor, or list
                           of such descriptors.
      :type band_to_calc: `str` or `list` of `str`
      :param check_nans: Boolean to run a check for NaN values and filter them out.
      :type check_nans: `bool`

      :returns: **stetsonJ** -- StetsonJ statistic for each of input bands.
      :rtype: `dict`

      .. note::

         In case that no value for `band_to_calc` is passed, the function is
         executed on all available bands in `band`.



.. py:data:: calc_stetson_J

