Skip to main content

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

  • Light Curve Generation: Support for loading and generating light curves from various sources such as Kepler / TESS, custom CSV files, and synthetic data generation. Synthetic light curves can be generated from user-specified noise parameters, or sampled from a multivariate normal distribution with a user-specified covariance kernel.
  • Gaussian Process Modeling: Principled modeling of stellar variability, with GPU-acceleration via GPyTorch.
  • 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.

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/.

License

This project is licensed under the MIT License.

Metadata

Release files for nahiku 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nahiku 0.1.2
File Size Uploaded Provenance Actions
nahiku-0.1.2.tar.gz 28.5 kB Without provenance Details for nahiku-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nahiku 0.1.2
File Interpreter ABI Platform Actions
nahiku-0.1.2-py3-none-any.whl Python 3 none any Details for nahiku-0.1.2-py3-none-any.whl

Total release size: 61.3 kB

Release files / nahiku-0.1.2.tar.gz

Download URL nahiku-0.1.2.tar.gz
Size 28.5 kB
Tags Source
SHA-256 checksum
How to use checksums
1c9d0f6c1b578d241820b20e6daedd807a400ce0798c2bb06033fad31b7c8af1
BLAKE2b-256 checksum
How to use checksums
8f9741c87f40e627a34dfe7f6835878c8a0c3bfbaa9f072274614f9e1c6a9a35
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release files / nahiku-0.1.2-py3-none-any.whl

Download URL nahiku-0.1.2-py3-none-any.whl
Size 32.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
651fc8b09ff5b17fd94d0c5a3c4c4ec9addd4d937f1a666a4be0c0b52d1defa1
BLAKE2b-256 checksum
How to use checksums
bc72541c32be2c0b987734ab821db93692ccd460fd4f0d32819d4cf47f1bb160
Upload date
Uploaded using Trusted Publishing?
What is 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}

Security for nahiku 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page