Coordinates in JAX
Project description
coordinax
Coordinates in JAX
Coordinax enables calculations with coordinates in JAX. Built on Equinox and Quax.
Installation
pip install coordinax
Documentation
Coming soon. In the meantime, if you've used astropy.coordinates
, then
coordinax
should be fairly intuitive.
Quick example
import coordinax as cx
import jax.numpy as jnp
from unxt import Quantity
q = cx.CartesianPos3D(
x=Quantity(jnp.arange(0, 10.0), "km"),
y=Quantity(jnp.arange(5, 15.0), "km"),
z=Quantity(jnp.arange(10, 20.0), "km"),
)
print(q)
# <CartesianPos3D (x[km], y[km], z[km])
# [[ 0. 5. 10.]
# [ 1. 6. 11.]
# ...
# [ 8. 13. 18.]
# [ 9. 14. 19.]]>
q2 = cx.represent_as(q, cx.SphericalPos)
print(q2)
# <SphericalPos (r[km], theta[rad], phi[rad])
# [[11.18 0.464 1.571]
# [12.57 0.505 1.406]
# ...
# [23.601 0.703 1.019]
# [25.259 0.719 0.999]]>
p = cx.CartesianVel3D(
d_x=Quantity(jnp.arange(0, 10.0), "m/s"),
d_y=Quantity(jnp.arange(5, 15.0), "m/s"),
d_z=Quantity(jnp.arange(10, 20.0), "m/s"),
)
print(p)
# <CartesianVel3D (d_x[m / s], d_y[m / s], d_z[m / s])
# [[ 0. 5. 10.]
# [ 1. 6. 11.]
# ...
# [ 8. 13. 18.]
# [ 9. 14. 19.]]>
p2 = cx.represent_as(p, cx.SphericalVel, q)
print(p2)
# <SphericalVel (d_r[m / s], d_theta[m rad / (km s)], d_phi[m rad / (km s)])
# [[ 1.118e+01 -3.886e-16 0.000e+00]
# [ 1.257e+01 -1.110e-16 0.000e+00]
# ...
# [ 2.360e+01 0.000e+00 0.000e+00]
# [ 2.526e+01 -2.776e-16 0.000e+00]]>
Citation
If you found this library to be useful in academic work, then please cite.
Development
We welcome contributions!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file coordinax-0.13.4.tar.gz
.
File metadata
- Download URL: coordinax-0.13.4.tar.gz
- Upload date:
- Size: 156.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0917516f9e9eee4e0117e7c49f2ebb8e43ad767e699947068c0a19b66bc4bbe1 |
|
MD5 | 9d7b8927941842a41f7b47b86e6d3b7a |
|
BLAKE2b-256 | 3e5e0c6b2c943f089cd66aa3b6448aaea32d9e15227a4c7a8ef7d401274127b1 |
Provenance
The following attestation bundles were made for coordinax-0.13.4.tar.gz
:
Publisher:
cd.yml
on GalacticDynamics/coordinax
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
coordinax-0.13.4.tar.gz
- Subject digest:
0917516f9e9eee4e0117e7c49f2ebb8e43ad767e699947068c0a19b66bc4bbe1
- Sigstore transparency entry: 149014098
- Sigstore integration time:
- Predicate type:
File details
Details for the file coordinax-0.13.4-py3-none-any.whl
.
File metadata
- Download URL: coordinax-0.13.4-py3-none-any.whl
- Upload date:
- Size: 123.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a36427b5cf345758d0ef268ddc944cb9ca77383b2db1d7801e785c0efeffb387 |
|
MD5 | 34ca032a4ac0fe7281a57f1b67419201 |
|
BLAKE2b-256 | df1ba5eba6e408f3d01c85b869495606c539e0d1af7fdde849230092aa597b21 |
Provenance
The following attestation bundles were made for coordinax-0.13.4-py3-none-any.whl
:
Publisher:
cd.yml
on GalacticDynamics/coordinax
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
coordinax-0.13.4-py3-none-any.whl
- Subject digest:
a36427b5cf345758d0ef268ddc944cb9ca77383b2db1d7801e785c0efeffb387
- Sigstore transparency entry: 149014100
- Sigstore integration time:
- Predicate type: