Period-finding with Phase Dispersion Minimization (pwkit.pdm)

pwkit.pdm - period-finding with phase dispersion minimization

As defined in Stellingwerf (1978ApJ…224..953S). See the update in Schwarzenberg-Czerny (1997ApJ…489..941S), however, which corrects the significance test formally; Linnell Nemec & Nemec (1985AJ…..90.2317L) provide a Monte Carlo approach. Also, Stellingwerf has developed “PDM2” which attempts to improve a few aspects; see

class pwkit.pdm.PDMResult(thetas, imin, pmin, mc_tmins, mc_pvalue, mc_pmins, mc_puncert)
imin

Alias for field number 1

mc_pmins

Alias for field number 5

mc_puncert

Alias for field number 6

mc_pvalue

Alias for field number 4

mc_tmins

Alias for field number 3

pmin

Alias for field number 2

thetas

Alias for field number 0

pwkit.pdm.pdm(t, x, u, periods, nbin, nshift=8, nsmc=256, numc=256, weights=False, parallel=True)[source]

Perform phase dispersion minimization.

t1D array

time coordinate

x1D array, same size as t

observed value

u1D array, same size as t

uncertainty on observed value; same units as x

periods1D array

set of candidate periods to sample; same units as t

nbinint

number of phase bins to construct

nshiftint=8

number of shifted binnings to sample to combact statistical flukes

nsmcint=256

number of Monte Carlo shufflings to compute, to evaluate the significance of the minimal theta value.

numcint=256

number of Monte Carlo added-noise datasets to compute, to evaluate the uncertainty in the location of the minimal theta value.

weightsbool=False

if True, ‘u’ is actually weights, not uncertainties. Usually weights = u**-2.

paralleldefault True

Controls parallelization of the algorithm. Default uses all available cores. See pwkit.parallel.make_parallel_helper.

Returns named tuple of:

thetas1D array

values of theta statistic, same size as periods

imin

index of smallest (best) value in thetas

pmin

the period value with the smallest (best) theta

mc_tmins

1D array of size nsmc with Monte Carlo samplings of minimal theta values for shufflings of the data; assesses significance of the peak

mc_pvalue

probability (between 0 and 1) of obtaining the best theta value in a randomly-shuffled dataset

mc_pmins

1D array of size numc with Monte Carlo samplings of best period values for noise-added data; assesses uncertainty of pmin

mc_puncert

standard deviation of mc_pmins; approximate uncertainty on pmin.

We don’t do anything clever, so runtime scales at least as t.size * periods.size * nbin * nshift * (nsmc + numc + 1).