Skip to main content

A package for dipper detection in lightcurves

Project description

Nāhiku

Anomaly Detection in Stellar Light Curves

Nāhiku is the ʻŌlelo Hawaiʻi word for the 'Big Dipper' constellation.

This is an open-source package to simplify the task of detecting anomalies in stellar light curves with a principled, probabilistic approach to light curve modeling and anomaly detection. Specifically, this package was developed for the use of detecting dipper anomalies, such as exocomets, in light curves.

Features

  • Gaussian Process Modeling: Principled modeling of stellar variability.
  • Prewhitening: Built-in support for removing stellar pulsations via the Balmung algorithm.
  • Anomaly Search: Both Greedy Search (fast, iterative) and Exhaustive Search (comprehensive window search) methods.
  • Synthetic Data Generation: Tools to create synthetic light curves, inject various anomaly shapes, and test recovery accuracy.

Installation

Nāhiku can be installed directly from PyPI:

pip install nahiku

Quick Example

Here is a short script to create a synthetic light curve, inject an anomaly, and recover it using the Greedy Search method:

import numpy as np
from nahiku import Nahiku

# 1. Create a simple synthetic light curve
x = np.arange(0, 100, 0.1)
y = np.sin(x) + np.random.normal(0, 0.1, size=x.shape)

# 2. Initialize Nahiku object and prewhiten the signal
nahiku = Nahiku(x, y)
nahiku.prewhiten(minimum_snr=1)

# 3. Inject an exocomet-shaped anomaly
nahiku.inject_anomaly(1, absolute_width=0.5, absolute_depth=5, shapes=["exocomet"], idxs=[350])

# 4. Search for the anomaly using Greedy Search
res = nahiku.greedy_search()
print(f"Greedy search found {res.num_detected_anomalies} anomalies.")

# 5. Visualize the search process and results
nahiku.plot()

Documentation

Full documentation, including API references and examples, can be found at: https://nahiku.readthedocs.io/ (once hosted).

License

This project is licensed under the MIT License.

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

nahiku-0.1.1.tar.gz (28.2 kB view details)

Uploaded Source

Built Distribution

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

nahiku-0.1.1-py3-none-any.whl (32.6 kB view details)

Uploaded Python 3

File details

Details for the file nahiku-0.1.1.tar.gz.

File metadata

  • Download URL: nahiku-0.1.1.tar.gz
  • Upload date:
  • Size: 28.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for nahiku-0.1.1.tar.gz
Algorithm Hash digest
SHA256 d815ab7bf9e960267c416391e03e8a9c068ef54d99401cddf9717e2320988c68
MD5 71b8d8fe9fee92d23aac8dcb14a55688
BLAKE2b-256 9abbb5cb0cfaf498c7cc84eb0ada524ab839ddcf686ff90b1a33b5b8e27d6d52

See more details on using hashes here.

File details

Details for the file nahiku-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: nahiku-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 32.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for nahiku-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ae71c08edda63da7621fe7c3824507df1e0ba59f9fd090e95f284290b1f1f945
MD5 70776e25272411326e9f911a966b3298
BLAKE2b-256 325d24ad5906bd3128b2b499a77ee5a6ab14461d349ac8bf4d5cd89c70ded9d5

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