Skip to main content

Fast entropy-based period finder for unevenly sampled astronomical time series

Project description

entropypf

Fast entropy-based period finder for unevenly sampled astronomical time series.

Implements the minimum Shannon entropy method introduced by Cincotta, Méndez & Núñez (1995, ApJ 449, 231) for detecting periodicity in variable-star light curves and other time series with irregular sampling.

Installation

pip install entropypf

Quick start

import numpy as np
from entropypf import find_best_period, get_entropies

# t: observation times (days), u: magnitudes
periods, entropies = find_best_period(t, u, p0=0.1, p1=10.0, p_num=5000)
print(f"Best period: {periods[0]:.4f} days  (entropy={entropies[0]:.4f})")

To inspect the full entropy periodogram:

trial_periods = np.linspace(0.1, 10.0, 5000)
S = get_entropies(t, u, trial_periods, L=7, K=7)
best = trial_periods[np.argmin(S)]

How it works

For each trial period p, the observations are folded into a phase–magnitude diagram on the unit square and divided into an L × K grid. The Shannon entropy of the resulting occupation-probability matrix is computed:

S = -∑ μᵢ ln(μᵢ)

When p equals the true period the light curve is ordered and entropy is low; otherwise the diagram is disordered and entropy is high. The true period corresponds to the deepest minimum of the entropy periodogram.

API

Function Description
find_best_period(t, u, p0, p1, p_num, ...) Full pipeline: builds period grid, removes aliases, returns top candidates
get_entropies(t, u, p, L, K) Vectorized entropy at each trial period
get_test_periods(p0, p1, n, ...) Non-uniform period grid (dense at short periods, sparse at long)
get_phases(t, u, period) Fold times into phases in [0, 1)
get_entropy(Mu) Shannon entropy of an occupation-probability matrix

See each function's docstring for full parameter details.

Reference

Cincotta, P. M., Méndez, M., & Núñez, J. A. (1995). Astronomical Time Series Analysis. I. A Search for Periodicity Using Information Entropy. ApJ, 449, 231. ADS

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

entropypf-0.1.0.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

entropypf-0.1.0-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file entropypf-0.1.0.tar.gz.

File metadata

  • Download URL: entropypf-0.1.0.tar.gz
  • Upload date:
  • Size: 10.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for entropypf-0.1.0.tar.gz
Algorithm Hash digest
SHA256 dac9fabd58b137883742a414e114985d237562a9a107134a9c6b5389910b0103
MD5 dd77c0716896377b01e18a7abf60a053
BLAKE2b-256 53a7d36539f42f78fdd70e9914132f5e645571e8c7144548f8aaab1cfe370879

See more details on using hashes here.

File details

Details for the file entropypf-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: entropypf-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for entropypf-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6e6e7969a78c171d5a8c78d917b2b9a6f71baf593e59231b8cca5f8017ccf318
MD5 bdf176ca413b4782f6dc22d32d1864c0
BLAKE2b-256 732828438ea6f8d494c94be54b55b98918e86e11423019226ad0e8d6c42231ae

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page