https://github.com/GalacticDynamics/coordinax
Coordinates in JAX
https://github.com/GalacticDynamics/coordinax
coordinate-systems coordinate-transformation coordinates jax
Last synced: about 1 year ago
JSON representation
Coordinates in JAX
- Host: GitHub
- URL: https://github.com/GalacticDynamics/coordinax
- Owner: GalacticDynamics
- License: mit
- Created: 2024-02-10T21:21:00.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-04T04:47:00.000Z (about 1 year ago)
- Last Synced: 2025-03-28T13:51:16.124Z (about 1 year ago)
- Topics: coordinate-systems, coordinate-transformation, coordinates, jax
- Language: Python
- Homepage:
- Size: 1.63 MB
- Stars: 17
- Watchers: 2
- Forks: 3
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
coordinax
Coordinates in JAX
---
Coordinax enables calculations with coordinates in
[JAX](https://jax.readthedocs.io/en/latest/). Built on
[Equinox](https://docs.kidger.site/equinox/) and
[Quax](https://github.com/patrick-kidger/quax).
## Installation
[![PyPI platforms][pypi-platforms]][pypi-link]
[![PyPI version][pypi-version]][pypi-link]
```bash
pip install coordinax
```
## Documentation
[](https://unxt.readthedocs.io/en/)
Coming soon. In the meantime, if you've used `astropy.coordinates`, then
`coordinax` should be fairly intuitive.
## Quick example
```python
import jax.numpy as jnp
import unxt as u
import coordinax as cx
q = cx.CartesianPos3D(
x=u.Quantity(jnp.arange(0, 10.0), "km"),
y=u.Quantity(jnp.arange(5, 15.0), "km"),
z=u.Quantity(jnp.arange(10, 20.0), "km"),
)
print(q)
#
q2 = cx.vconvert(cx.SphericalPos, q)
print(q2)
#
p = cx.CartesianVel3D(
d_x=u.Quantity(jnp.arange(0, 10.0), "m/s"),
d_y=u.Quantity(jnp.arange(5, 15.0), "m/s"),
d_z=u.Quantity(jnp.arange(10, 20.0), "m/s"),
)
print(p)
#
p2 = cx.vconvert(cx.SphericalVel, p, q)
print(p2)
#
```
## Citation
[![DOI][zenodo-badge]][zenodo-link]
If you found this library to be useful in academic work, then please cite.
## Development
[![Actions Status][actions-badge]][actions-link]
[![Documentation Status][rtd-badge]][rtd-link]
[![codecov][codecov-badge]][codecov-link]
[![SPEC 0 — Minimum Supported Dependencies][spec0-badge]][spec0-link]
[![pre-commit][pre-commit-badge]][pre-commit-link]
[![ruff][ruff-badge]][ruff-link]
We welcome contributions!
[actions-badge]: https://github.com/GalacticDynamics/coordinax/workflows/CI/badge.svg
[actions-link]: https://github.com/GalacticDynamics/coordinax/actions
[codecov-badge]: https://codecov.io/gh/GalacticDynamics/unxt/graph/badge.svg
[codecov-link]: https://codecov.io/gh/GalacticDynamics/unxt
[pre-commit-badge]: https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit
[pre-commit-link]: https://pre-commit.com
[pypi-link]: https://pypi.org/project/coordinax/
[pypi-platforms]: https://img.shields.io/pypi/pyversions/coordinax
[pypi-version]: https://img.shields.io/pypi/v/coordinax
[rtd-badge]: https://readthedocs.org/projects/coordinax/badge/?version=latest
[rtd-link]: https://coordinax.readthedocs.io/en/latest/?badge=latest
[ruff-badge]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json
[ruff-link]: https://docs.astral.sh/ruff/
[spec0-badge]: https://img.shields.io/badge/SPEC-0-green?labelColor=%23004811&color=%235CA038
[spec0-link]: https://scientific-python.org/specs/spec-0000/
[zenodo-badge]: https://zenodo.org/badge/755708966.svg
[zenodo-link]: https://zenodo.org/doi/10.5281/zenodo.10850557