tape.analysis.stetsonj#

Attributes#

Classes#

StetsonJ

Compute the StetsonJ statistic on data from one or several bands

Module Contents#

class StetsonJ[source]#

Bases: tape.analysis.base.AnalysisFunction

Compute the StetsonJ statistic on data from one or several bands

cols(ens: Ensemble) List[str][source]#

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

Parameters:

ens (Ensemble) – The ensemble object, it could be required to get column names of the “special” columns like ens._time_col or ens._err_col.

Returns:

The column names to select and pass to .calculate() method. For example [ens._time_col, ens._flux_col].

Return type:

List[str]

meta(ens: Ensemble)[source]#

Return the schema of the analysis function output.

Parameters:

ens (Ensemble) – The ensemble object.

Returns:

pd.DataFrame or (str, dtype) tuple or {str – Dask meta, for example pd.DataFrame(columns=[‘x’, ‘y’], dtype=float).

Return type:

dtype} dictionary

on(ens: Ensemble) List[str][source]#

Return the columns to group source table by.

Parameters:

ens (Ensemble) – The ensemble object.

Returns:

The column names to group by. Typically, [ens._id_col].

Return type:

List[str]

__call__(flux: numpy.ndarray, err: numpy.ndarray, band: numpy.ndarray, *, band_to_calc: str | Iterable[str] | None = None, check_nans: bool = False)[source]#

Compute the StetsonJ statistic on data from one or several bands

Parameters:
  • flux (numpy.ndarray (N,)) – Array of flux/magnitude measurements

  • err (numpy.ndarray (N,)) – Array of associated flux/magnitude errors

  • band (numpy.ndarray (N,)) – Array of associated band labels

  • band_to_calc (str or list of str) – Bands to calculate StetsonJ on. Single band descriptor, or list of such descriptors.

  • check_nans (bool) – Boolean to run a check for NaN values and filter them out.

Returns:

stetsonJ – StetsonJ statistic for each of input bands.

Return type:

dict

Note

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

calc_stetson_J[source]#