Scanner and PDM class¶
The Scanner and PyPDM class are used to carry out the PDM analysis.
The Scanner class¶
- class PyAstronomy.pyTiming.pyPDM.Scanner(minVal=0.1, maxVal=10.0, dVal=0.05, mode='period')¶
The Scanner class is used to define the period/frequency range and steps used in the PDM analysis. It is iteratable.
- Parameters:
minVal - float, Minimum value,
maxVal - float, Maximum value,
dVal - float, Delta value,
mode - string, optional, Either “period” or “frequency” (default = “period”).
The PyPDM class¶
- class PyAstronomy.pyTiming.pyPDM.PyPDM(time, mag)¶
This class allows to carry out a ``Phase Dispersion Minimization’’ (PDM) analysis as described in Stellingwerf 1978.
- Parameters:
time - array, The time array (arbitrary time units),
mag - array, The corresponding flux in magnitudes.
- Properties:
- minBinPoints - The minimum number of data points,
which may be contained in an individual bin (default = 3).
Methods
pdmEquiBin
(nbins, scanner)Carry out the PDM analysis using equidistant bins.
pdmEquiBinCover
(nbins, covers, scanner)Carry out the PDM analysis using multiple sequences of equidistant bins.
phase
(time, period)Calculate phases and ordering.
- pdmEquiBin(nbins, scanner)¶
Carry out the PDM analysis using equidistant bins.
This method uses equidistant bins, yet, it pays attention to the number of data points contained in individual bins. If this number is insufficient (as defined by the minBinPoints property), adjacent bins are combined (see documentation of __setUpEquiBlocks).
- Parameters:
nbins - int, Number of bins to use.
- scanner - An instance of the Scanner class, defining, which periods/frequencies
are tested.
Returns two arrays: the periods and the associated values of the Theta statistic. These are also saved to the class properties periods, frequencies, and theta.
Note
Whether the first return value is frequency or period depends on the mode of the scanner.
- pdmEquiBinCover(nbins, covers, scanner)¶
Carry out the PDM analysis using multiple sequences of equidistant bins.
The bins used by this method are equidistant, but the phase axis and, thus, the data points are covered by multiple bins. The first sequence of bins is the usual devision of the 0-1 interval into nbins bins; the following sequences are the same but offset of 1/(nbins*covers) in phase (the phase axis is cyclic).
This method does not check whether bins contain “enough” data points, i.e., it neglects the minBinPoints property taken into account by pdmEquiBin. If, however, less than two data points are contained within a bin, it is neglected.
- Parameters:
nbins - int, Number of bins to use.
scanner - An instance of the Scanner class, defining, which periods/frequencies are tested.
covers - int, The number of covers, i.e., phase-shifted bin sets.
Returns two arrays: the periods/frequencies and the associated values of the Theta statistic. These are also saved to the class properties ``periods’’, ``frequencies’’, and ``theta’’.
Note
Whether the first return value is frequency or period depends on the mode of the scanner.
- phase(time, period)¶
Calculate phases and ordering.
- Parameter:
time - array, Time stamps,
period - float, The period used to calculate phases.
- Returns:
An unsorted phase array and an array with indices specifying the order. Thus, phase[indi], mag[indi] is the phase-sorted phased light curve.