Metadata-Version: 2.3
Name: nahiku
Version: 0.1.2
Summary: A package for dipper detection in lightcurves
Author: Linnea Wolniewicz
Author-email: Linnea Wolniewicz <linnea@wolniewicz.com>
Requires-Dist: alembic>=1.13.1
Requires-Dist: astropy==6.1.0
Requires-Dist: astroquery==0.4.11
Requires-Dist: autograd>=1.8.0
Requires-Dist: beautifulsoup4>=4.14.2
Requires-Dist: bokeh>=3.8.2
Requires-Dist: colorlog>=6.8.2
Requires-Dist: fbpca>=1.0
Requires-Dist: fsspec>=2024.6.0
Requires-Dist: future>=1.0.0
Requires-Dist: gpytorch==1.11
Requires-Dist: html5lib>=1.1
Requires-Dist: jaxtyping==0.2.30
Requires-Dist: joblib>=1.4.2
Requires-Dist: lightkurve==2.5.0
Requires-Dist: lightning>=2.2.5
Requires-Dist: lightning-utilities>=0.11.2
Requires-Dist: matplotlib==3.8.4
Requires-Dist: memoization>=0.4.0
Requires-Dist: mpmath>=1.3.0
Requires-Dist: narwhals>=2.7.0
Requires-Dist: networkx>=3.2.1
Requires-Dist: numpy==1.26.4
Requires-Dist: oktopus>=0.1.2
Requires-Dist: optuna>=3.6.1
Requires-Dist: pandas==2.2.2
Requires-Dist: patsy>=1.0.2
Requires-Dist: pillow>=10.3.0
Requires-Dist: psutil>=5.9.0
Requires-Dist: pyvo>=1.8
Requires-Dist: pyyaml>=6.0.1
Requires-Dist: scikit-learn>=1.5.0
Requires-Dist: scipy==1.13.1
Requires-Dist: sqlalchemy>=2.0.30
Requires-Dist: sympy>=1.12
Requires-Dist: threadpoolctl>=3.5.0
Requires-Dist: torch==2.3.1
Requires-Dist: torchmetrics>=1.4.0.post0
Requires-Dist: torchvision==0.18.1
Requires-Dist: torchaudio==2.3.1
Requires-Dist: tqdm>=4.66.4
Requires-Dist: uncertainties>=3.2.0
Requires-Dist: xyzservices>=2025.4.0
Requires-Python: >=3.12
Description-Content-Type: text/markdown

# 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:

```bash
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:

```python
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/](https://nahiku.readthedocs.io/).

## License

This project is licensed under the MIT License.
