tape.analysis.structurefunction2#
Module Contents#
Classes#
Calculate structure function squared |
Attributes#
- class StructureFunction2[source]#
Bases:
tape.analysis.base.AnalysisFunctionCalculate structure function squared
- 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) Dict[str, type][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__(time, flux, err=None, band=None, lc_id=None, *, sf_method='basic', argument_container=None) pandas.DataFrame[source]#
Calculate structure function squared using one of a variety of structure function calculation methods defined by the input argument sf_method, or in the argument container object.
- Parameters:
time (numpy.ndarray (N,) or None) – Array of times when measurements were taken. If all array values are None or if a scalar None is provided, then equidistant time between measurements is assumed.
flux (numpy.ndarray (N,)) – Array of flux/magnitude measurements.
err (numpy.ndarray (N,), float, or None, optional) – Array of associated flux/magnitude errors. If a scalar value is provided we assume that error for all measurements. If None is provided, we assume all errors are 0. By default None
band (numpy.ndarray (N,), optional) – Array of associated band labels, by default None
lc_id (numpy.ndarray (N,), optional) – Array of lightcurve ids per data point. By default None
sf_method (str, optional) – The structure function calculation method to be used, by default “basic”.
argument_container (StructureFunctionArgumentContainer, optional) – Container object for additional configuration options, by default None.
- Returns:
sf2 – Structure function squared for each of input bands.
- Return type:
pandas.DataFrame
Notes
In case that no value for band_to_calc is passed, the function is executed on all available bands in band.