Home

Awesome

<h1 align='center'> galax </h1> <h2 align="center">Galactic and Gravitational Dynamics</h2>

Installation

PyPI platforms PyPI version

<!-- [![Conda-Forge][conda-badge]][conda-link] -->
pip install galax

Documentation

Documentation Status

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

Quick example

Let's compute an orbit!

import jax.numpy as jnp

import unxt as u
import coordinax as cx
import galax.coordinates as gc
import galax.dynamics as gd
import galax.potential as gp

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

pot = gp.MilkyWayPotential()

orbit = gd.evaluate_orbit(pot, w, u.Quantity(jnp.linspace(0, 1, 100), "Gyr"))
print(orbit)
# Orbit(
#     q=<CartesianPos3D (x[kpc], y[kpc], z[kpc])
#         [[ 8.     0.     0.   ]
#          ...
#          [ 7.804 -0.106  0.   ]]>,
#     p=<CartesianVel3D (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.vconvert(cx.vecs.LonLatSphericalPos)
print(orbit_sph)
# Orbit(
#     q=<LonLatSphericalPos (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

If you found this library to be useful in academic work, then please cite.

Development

Actions Status

We welcome contributions!

Contributors

See the AUTHORS.rst file for a complete list of contributors to the project.

The GalacticDynamics/galax maintainers would like to thank @Michael Anckaert for transferring the galax project domain on PyPI for use by this package. Without his generosity this package would have had a worse name.

<!-- SPHINX-START --> <!-- prettier-ignore-start --> <!-- prettier-ignore-end -->