Skip to content

nstarman/galax

This branch is 1 commit ahead of, 247 commits behind GalacticDynamics/galax:main.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Sep 17, 2024
5cae21e · Sep 17, 2024
Aug 23, 2024
Sep 16, 2024
Aug 23, 2024
Sep 17, 2024
Sep 17, 2024
Apr 27, 2024
Nov 5, 2023
Nov 5, 2023
Jan 27, 2024
Sep 9, 2024
Apr 27, 2024
Jan 26, 2024
Jul 18, 2024
Jul 17, 2024
Sep 10, 2024
Jun 14, 2024
Sep 17, 2024

Repository files navigation

galax

Galactic and Gravitational Dynamics

Installation

PyPI platforms PyPI version

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

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.

About

No description, website, or topics provided.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%