/Py-PDM

A Python wrapper of the Phase Dispersion Minimization (PDM), which is a C code written by Stellingwerf.

Primary LanguageCGNU General Public License v3.0GPL-3.0

Py-PDM

image Documentation Status CI GitHub

A Python wrapper of the Phase Dispersion Minimization (PDM), which is a C code written by Stellingwerf.

Compared with other Python implementations, with the help of Cython, we can obtain a much faster PDM tool.

Example result

The red lines show the true frequency and its n times period.

Performance

Compared to the Pure Python implementation of PDM of PyAstronomy:

Comparison result

Installation

Before installing, make sure you have already installed the cython and numpy in your Python3 environment.

To install Py-PDM with pip:

pip install py-pdm

Alternatively you can install it manually:

git clone https://github.com/ckm3/Py-PDM.git
cd Py-PDM
python setup.py install

Usage

from pdmpy import pdm

freq, theta = pdm(time, y_value, y_sigma, frequency_min, frequency_max, frequency_step, number_of_bins)

Please refer to the documentation to see in details.

Citing

If you find Py-PDM useful in your research, please cite the orginal paper Stellingwerf, Astrophysical Journal, v224, p953, 1978 and add a footnote of this Github repository.