plotypus.periodogram module

Period finding and rephasing functions.

plotypus.periodogram.find_period(data, min_period=0.2, max_period=32.0, coarse_precision=1e-5, fine_precision=1e-9, periodogram=Lomb_Scargle, period_jobs=1)[source]

Returns the period of data according to the given periodogram, searching first with a coarse precision, and then a fine precision.

Parameters

data
: array-like, shape = [n_samples, 2] or [n_samples, 3]
Array containing columns time, mag, and (optional) error.
min_period
: number
Minimum period in search-space.
max_period
: number
Maximum period in search-space.
coarse_precision
: number
Distance between contiguous frequencies in search-space during first sweep.
fine_precision
: number
Distance between contiguous frequencies in search-space during second sweep.
periodogram
: function
A function with arguments data, precision, min_period, max_period, and period_jobs, and return value period.
period_jobs
: int, optional
Number of simultaneous processes to use while searching (default 1).

Returns

period
: number
The period of data.
plotypus.periodogram.conditional_entropy(data, precision, min_period, max_period, xbins=10, ybins=5, period_jobs=1)[source]

Returns the period of data by minimizing conditional entropy. See link [GDDMD] for details.

Parameters

data
: array-like, shape = [n_samples, 2] or [n_samples, 3]
Array containing columns time, mag, and (optional) error.
precision
: number
Distance between contiguous frequencies in search-space.
min_period
: number
Minimum period in search-space.
max_period
: number
Maximum period in search-space.
xbins
: int, optional
Number of phase bins for each trial period (default 10).
ybins
: int, optional
Number of magnitude bins for each trial period (default 5).
period_jobs
: int, optional
Number of simultaneous processes to use while searching. Only one process will ever be used, but argument is included to conform to periodogram standards of find_period() (default 1).

Returns

period
: number
The period of data.

Citations

[GDDMD]Graham, Matthew J. ; Drake, Andrew J. ; Djorgovski, S. G. ; Mahabal, Ashish A. ; Donalek, Ciro, 2013, Monthly Notices of the Royal Astronomical Society, Volume 434, Issue 3, p.2629-2635
plotypus.periodogram.CE(period, data, xbins=10, ybins=5)[source]

Returns the conditional entropy of data rephased with period.

Parameters

period
: number
The period to rephase data by.
data
: array-like, shape = [n_samples, 2] or [n_samples, 3]
Array containing columns time, mag, and (optional) error.
xbins
: int, optional
Number of phase bins (default 10).
ybins
: int, optional
Number of magnitude bins (default 5).
plotypus.periodogram.Lomb_Scargle(data, precision, min_period, max_period, period_jobs=1)[source]

Returns the period of data according to the Lomb-Scargle periodogram.

Parameters

data
: array-like, shape = [n_samples, 2] or [n_samples, 3]
Array containing columns time, mag, and (optional) error.
precision
: number
Distance between contiguous frequencies in search-space.
min_period
: number
Minimum period in search-space.
max_period
: number
Maximum period in search-space.
period_jobs
: int, optional
Number of simultaneous processes to use while searching. Only one process will ever be used, but argument is included to conform to periodogram standards of find_period() (default 1).

Returns

period
: number
The period of data.
plotypus.periodogram.rephase(data, period=1.0, shift=0.0, col=0, copy=True)[source]

Returns data (or a copy) phased with period, and shifted by a phase-shift shift.

Parameters

data
: array-like, shape = [n_samples, n_cols]
Array containing the time or phase values to be rephased in column col.
period
: number, optional
Period to phase data by (default 1.0).
shift
: number, optional
Phase shift to apply to phases (default 0.0).
col
: int, optional
Column in data containing the time or phase values to be rephased (default 0).
copy
: bool, optional
If True, a new array is returned, otherwise data is rephased in-place (default True).

Returns

rephased
: array-like, shape = [n_samples, n_cols]
Array containing the rephased data.
plotypus.periodogram.get_phase(time, period=1.0, shift=0.0)[source]

Returns time transformed to phase-space with period, after applying a phase-shift shift.

Parameters

time
: array-like, shape = [n_samples]
The times to transform.
period
: number, optional
The period to phase by (default 1.0).
shift
: number, optional
The phase-shift to apply to the phases (default 0.0).

Returns

phase
: array-like, shape = [n_samples]
time transformed into phase-space with period, after applying a phase-shift shift.