Metadata-Version: 2.4
Name: batcamp
Version: 0.1.0
Summary: Octree reconstruction and interpolation utilities
Author: Dag Evensberget
License-Expression: MIT
Project-URL: Homepage, https://github.com/svaberg/batcamp
Project-URL: Repository, https://github.com/svaberg/batcamp
Project-URL: Issues, https://github.com/svaberg/batcamp/issues
Keywords: octree,interpolation,amr,batsrus,simulation
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: batread>=1.0.0
Requires-Dist: numpy
Requires-Dist: numba
Provides-Extra: tests
Requires-Dist: pytest; extra == "tests"
Requires-Dist: pytest-cov; extra == "tests"
Requires-Dist: pooch; extra == "tests"
Requires-Dist: nbclient; extra == "tests"
Requires-Dist: nbformat; extra == "tests"
Requires-Dist: ipykernel; extra == "tests"
Requires-Dist: matplotlib; extra == "tests"
Requires-Dist: scipy; extra == "tests"
Requires-Dist: vulture; extra == "tests"
Provides-Extra: examples
Requires-Dist: scipy; extra == "examples"
Requires-Dist: matplotlib; extra == "examples"
Requires-Dist: pooch; extra == "examples"
Requires-Dist: jupyter; extra == "examples"
Requires-Dist: nbconvert; extra == "examples"
Requires-Dist: ipykernel; extra == "examples"
Dynamic: license-file

<h1><img src="https://raw.githubusercontent.com/svaberg/batcamp/0.0.0/assets/batcamp.png" alt="batcamp logo"> batcamp</h1>

`batcamp` reconstructs octrees from BATSRUS-like outputs, with support for both spherical and cartesian data.

## What it does

- Rebuilds a usable octree from simulation output
- Supports saving and loading reconstructed octrees
- Fast, octree-aware resampling to e.g. planes and spheres

## Why

Many outputs provide leaf-cell values without storing the octree data. `batcamp` rebuilds that structure, permitting rapid interpolation and resampling.

## Quick start
Install with `pip`:

```bash
pip install batcamp
```
The examples below use `batread` to read BATSRUS/Tecplot files.

The following code plots a two dimensional density slice.
```python
import numpy as np
import matplotlib.pyplot as plt

from batread.dataset import Dataset
from batcamp import OctreeInterpolator

# Read the dataset
ds = Dataset.from_file("MY_FILE")

# Create the interpolator; the octree is built automatically.
interp = OctreeInterpolator(ds, ["Rho [g/cm^3]"])

# Create a grid of points and interpolate the density
X, Y = np.meshgrid(np.linspace(-20, 20, 100), np.linspace(-20, 20, 100))
Z = np.zeros_like(X)
rho = interp(X, Y, Z)
plt.pcolormesh(X, Y, rho, norm="log")
```

See the running example notebook: [examples/quick_start.ipynb](https://github.com/svaberg/batcamp/blob/main/examples/quick_start.ipynb).
