Skip to main content

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 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.PhaseSpaceCoordinate(
    t=u.Q(0, "Myr"), q=u.Q([8, 0, 0], "kpc"), p=u.Q([0, 220, 0], "km/s")
)

pot = gp.MilkyWayPotential()

orbit = gd.evaluate_orbit(pot, w, u.Q(jnp.linspace(0, 1, 100), "Gyr"))
print(orbit)
# Orbit(
#     q=<CartesianPos3D: (x, y, z) [kpc]
#         [[ 8.     0.     0.   ]
#          ...
#          [ 7.804 -0.106  0.   ]]>,
#     p=<CartesianVel3D: (x, y, z) [kpc / Myr]
#         [[ 0.     0.225  0.   ]
#          ...
#          [ 0.018  0.23   0.   ]]>,
#     t=Q([0., ..., 1000.], 'Myr')
# )

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 (lon[rad / Myr], lat[deg / Myr], distance[kpc / Myr])
#         [[ 0.028  0.     0.   ]
#          ...
#          [ 0.03   0.     0.015]]>,
#     t=Quantity(Array([0., ..., 1000.], dtype=float64), unit='Myr')
# )

Citation

DOI

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

Development

Actions Status

We welcome contributions!

Galax uses uv for development dependency management (make sure you have uv version >=0.4.27 installed). For example, to run the test suite, install the test group and run pytest with:

uv sync --group test
uv run pytest src docs tests

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

galax-0.0.3.tar.gz (366.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

galax-0.0.3-py3-none-any.whl (268.1 kB view details)

Uploaded Python 3

File details

Details for the file galax-0.0.3.tar.gz.

File metadata

  • Download URL: galax-0.0.3.tar.gz
  • Upload date:
  • Size: 366.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for galax-0.0.3.tar.gz
Algorithm Hash digest
SHA256 696c2eefbb6a9417daf3d99ff08a6e9ccdfd1d92962e64da9f77f8aa7e0d55bb
MD5 9f75425b132cf8d765179152df7622d7
BLAKE2b-256 971f82fd9cd15f6dd7309de873ed2bf304f557ed5e352929f789bbbbed9cd27a

See more details on using hashes here.

Provenance

The following attestation bundles were made for galax-0.0.3.tar.gz:

Publisher: cd.yml on GalacticDynamics/galax

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file galax-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: galax-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 268.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for galax-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a333c84275a8191ca99e1c4157ca618fae9f55c1361de7098c9075332e49d689
MD5 63bf44a0975b3c802e835bdf0894df92
BLAKE2b-256 44d51b28e14f3456fdfcc1a731c431ccadeb7636efeff04aacbece9bd4b11d54

See more details on using hashes here.

Provenance

The following attestation bundles were made for galax-0.0.3-py3-none-any.whl:

Publisher: cd.yml on GalacticDynamics/galax

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 files

0.0.2

2 files

0.0.1

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page