Skip to content

Commit

Permalink
docs: update readme (#354)
Browse files Browse the repository at this point in the history
Signed-off-by: nstarman <nstarman@users.noreply.github.com>
  • Loading branch information
nstarman committed Jun 15, 2024
1 parent b0131b2 commit 179e0ac
Showing 1 changed file with 82 additions and 8 deletions.
90 changes: 82 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,88 @@
# galax
<h1 align='center'> galax </h1>
<h2 align="center">Galactic and Gravitational Dynamics</h2>

[![Actions Status][actions-badge]][actions-link]
[![Code Coverage][codecov-badge]][codecov-link]
[![Documentation Status][rtd-badge]][rtd-link]
## Installation

[![PyPI version][pypi-version]][pypi-link]
[![Conda-Forge][conda-badge]][conda-link]
[![PyPI platforms][pypi-platforms]][pypi-link]
[![PyPI version][pypi-version]][pypi-link]

<!-- [![Conda-Forge][conda-badge]][conda-link] -->

```bash
pip install galax
```

## Documentation

[![Documentation Status][rtd-badge]][rtd-link]

Coming soon. In the meantime, if you've used `gala`, then `galax` should be
familiar!

## Quick example

Let's compute an orbit!

```python
import coordinax as cx
import galax.coordinates as gc
import galax.dynamics as gd
import galax.potential as gp
import jax.numpy as jnp
from unxt import Quantity

w = gc.PhaseSpacePosition(
q=Quantity([8, 0, 0], "kpc"),
p=Quantity([0, 220, 0], "km/s"),
t=Quantity(0, "Myr"),
)

pot = gp.MilkyWayPotential()

orbit = gd.evaluate_orbit(pot, w, Quantity(jnp.linspace(0, 1, 100), "Gyr"))
print(orbit)
# Orbit(
# q=<CartesianPosition3D (x[kpc], y[kpc], z[kpc])
# [[ 8. 0. 0. ]
# ...
# [ 7.804 -0.106 0. ]]>,
# p=<CartesianVelocity3D (d_x[kpc / Myr], d_y[kpc / Myr], d_z[kpc / Myr])
# [[ 0. 0.225 0. ]
# ...
# [ 0.018 0.23 0. ]]>,
# t=Quantity['time'](Array([0., ..., 1000.], dtype=float64), unit='Myr'),
# potential=MilkyWayPotential(...)
# )

orbit_sph = orbit.represent_as(cx.LonLatSphericalPosition)
print(orbit_sph)
# Orbit(
# q=<LonLatSphericalPosition (lon[rad], lat[deg], distance[kpc])
# [[0.000e+00 3.858e-16 8.000e+00]
# ...
# [6.270e+00 3.858e-16 7.805e+00]]>,
# p=<LonLatSphericalVelocity (d_lon[rad / Myr], d_lat[deg / Myr], d_distance[kpc / Myr])
# [[ 0.028 0. 0. ]
# ...
# [ 0.03 0. 0.015]]>,
# t=Quantity['time'](Array([0., ..., 1000.], dtype=float64), unit='Myr'),
# potential=MilkyWayPotential(...})
# )
```

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

[![GitHub Discussion][github-discussions-badge]][github-discussions-link]
We welcome contributions!

## Contributors
### Contributors

See the
[AUTHORS.rst](https://github.com/GalacticDynamics/galax/blob/main/AUTHORS.rst)
Expand Down Expand Up @@ -38,5 +110,7 @@ this package would have had a worse name.
[pypi-version]: https://img.shields.io/pypi/v/galax
[rtd-badge]: https://readthedocs.org/projects/galax/badge/?version=latest
[rtd-link]: https://galax.readthedocs.io/en/latest/?badge=latest
[zenodo-badge]: https://zenodo.org/badge/706347349.svg
[zenodo-link]: https://zenodo.org/doi/10.5281/zenodo.11553324

<!-- prettier-ignore-end -->

0 comments on commit 179e0ac

Please sign in to comment.