tape.timeseries#

Classes#

TimeSeries

Represent and analyze Rubin TimeSeries data

Module Contents#

class TimeSeries(data=None)[source]#

Represent and analyze Rubin TimeSeries data

data[source]#
meta[source]#
colmap[source]#
from_dict(data_dict, time_label='time', flux_label='flux', err_label='flux_err', band_label='band')[source]#

Build dataframe from a python dictionary

Parameters:
  • data_dict (dict) – Dictionary contaning the data.

  • time_label (str) – Name for column containing time information.

  • flux_label (str) – Name for column containing signal (flux, magnitude, etc) information.

  • err_label (str) – Name for column containing error information.

  • band_label (str) – Name for column containing filter information.

dropna(**kwargs)[source]#

Handle NaN values, wrapper for pandas.DataFrame.dropna

from_dataframe(data, object_id, time_label='time', flux_label='flux', err_label='flux_err', band_label='band')[source]#

Loader function for inputing data from a dataframe.

Parameters:
  • data (pandas.DataFrame) – The data for the time serires.

  • object_id (str) – The ID of the current object.

  • time_label (str) – Name for column containing time information.

  • flux_label (str) – Name for column containing signal (flux, magnitude, etc) information.

  • err_label (str) – Name for column containing error information.

  • band_label (str) – Name for column containing filter information.

property time[source]#
Time values stored as a Pandas Series
property flux[source]#
Flux values stored as a Pandas Series
property flux_err[source]#
Flux error values stored as a Pandas Series
property band[source]#
Band labels stored as a Pandas Index
_build_index(band)[source]#

Build pandas multiindex from band array

stetson_J(band=None)[source]#

Compute the stetsonJ statistic on data from one or several bands

Parameters:

band (str or list of str) – Single band descriptor, or list of such descriptors.

Returns:

stetsonJ – StetsonJ statistic for each of input bands.

Return type:

dict

Note

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

sf2(sf_method='basic', argument_container=None)[source]#

Compute the structure function squared statistic on data

Parameters:
  • bins (numpy.array or list) – Manually provided bins, if not provided then bins are computed using the method kwarg

  • band_to_calc (str or list of str) – Single band descriptor, or list of such descriptors.

  • method ('str') – The binning method to apply, choices of ‘size’; which seeks an even distribution of samples per bin using quantiles, ‘length’; which creates bins of equal length in time and ‘loglength’; which creates bins of equal length in log time.

  • sthresh ('int') – Target number of samples per bin.

Returns:

stetsonJ – Structure function squared 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.