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

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

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.2.tar.gz (28.5 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.2-py3-none-any.whl (32.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nahiku-0.1.2.tar.gz
  • Upload date:
  • Size: 28.5 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.2.tar.gz
Algorithm Hash digest
SHA256 1c9d0f6c1b578d241820b20e6daedd807a400ce0798c2bb06033fad31b7c8af1
MD5 01765151cad4ba879c7e67e5c134daf0
BLAKE2b-256 8f9741c87f40e627a34dfe7f6835878c8a0c3bfbaa9f072274614f9e1c6a9a35

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nahiku-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 32.9 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 651fc8b09ff5b17fd94d0c5a3c4c4ec9addd4d937f1a666a4be0c0b52d1defa1
MD5 965072daddaca4423b6dff94c96b4e59
BLAKE2b-256 bc72541c32be2c0b987734ab821db93692ccd460fd4f0d32819d4cf47f1bb160

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