coordinax 0.22.1
pip install coordinax==0.22.1
Released:
Coordinates in JAX
Navigation
Verified details
These details have been verified by PyPIProject links
GitHub Statistics
Maintainers
Unverified details
These details have not been verified by PyPIMeta
- License: MIT License (Copyright 2024 Galactic Dynamics maintainers)
- Author: Coordinax Devs
- Requires: Python >=3.11
-
Provides-Extra:
all
Classifiers
- Development Status
- Intended Audience
- License
- Operating System
- Programming Language
- Topic
- Typing
Project description
coordinax
Coordinates in JAX
Coordinax enables calculations with coordinates in JAX. Built on Equinox and Quax.
Installation
pip install coordinax
Documentation
Quick example
import jax.numpy as jnp
import unxt as u
import coordinax as cx
q = cx.CartesianPos3D(
x=u.Quantity(jnp.arange(0, 10.0), "kpc"),
y=u.Quantity(jnp.arange(5, 15.0), "kpc"),
z=u.Quantity(jnp.arange(10, 20.0), "kpc"),
)
print(q)
# <CartesianPos3D: (x, y, z) [kpc]
# [[ 0. 5. 10.]
# [ 1. 6. 11.]
# ...
# [ 8. 13. 18.]
# [ 9. 14. 19.]]>
q2 = cx.vconvert(cx.SphericalPos, q)
print(q2)
# <SphericalPos: (r[kpc], 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(
x=u.Quantity(jnp.arange(0, 10.0), "km/s"),
y=u.Quantity(jnp.arange(5, 15.0), "km/s"),
z=u.Quantity(jnp.arange(10, 20.0), "km/s"),
)
print(p)
# <CartesianVel3D: (x, y, z) [km / s]
# [[ 0. 5. 10.]
# [ 1. 6. 11.]
# ...
# [ 8. 13. 18.]
# [ 9. 14. 19.]]>
p2 = cx.vconvert(cx.SphericalVel, p, q)
print(p2)
# <SphericalVel: (r[km / s], theta[km rad / (km s)], phi[km 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]]>
# Transforming between frames
icrs_frame = cx.frames.ICRS()
gc_frame = cx.frames.Galactocentric()
op = cxf.frame_transform_op(icrs_frame, gc_frame)
q_gc, p_gc = op(q, p)
print(q_gc, p_gc, sep="\n")
# <CartesianPos3D: (x, y, z) [kpc]
# [[-1.732e+01 5.246e+00 3.614e+00]
# ...
# [-3.004e+01 1.241e+01 -1.841e+00]]>
# <CartesianVel3D: (x, y, z) [km / s]
# [[ 3.704 250.846 11.373]
# ...
# [ -9.02 258.012 5.918]]>
coord = cx.Coordinate(cx.Space(length=q, speed=p), frame=icrs_frame)
print(coord)
# Coordinate(
# data=Space({
# 'length': <CartesianPos3D: (x, y, z) [kpc]
# [[ 0. 5. 10.]
# ...
# [ 9. 14. 19.]]>,
# 'speed': <CartesianVel3D: (x, y, z) [km / s]
# [[ 0. 5. 10.]
# ...
# [ 9. 14. 19.]]>
# }),
# frame=ICRS()
# )
print(coord.to_frame(gc_frame))
# Coordinate(
# data=Space({
# 'length': <CartesianPos3D: (x, y, z) [kpc]
# [[-1.732e+01 5.246e+00 3.614e+00]
# ...
# [-3.004e+01 1.241e+01 -1.841e+00]]>,
# 'speed': <CartesianVel3D: (x, y, z) [km / s]
# [[ 3.704 250.846 11.373]
# ...
# [ -9.02 258.012 5.918]]>
# }),
# frame=Galactocentric( ... )
# )
Citation
If you found this library to be useful in academic work, then please cite.
Development
We welcome contributions!
Project details
Verified details
These details have been verified by PyPIProject links
GitHub Statistics
Maintainers
Unverified details
These details have not been verified by PyPIMeta
- License: MIT License (Copyright 2024 Galactic Dynamics maintainers)
- Author: Coordinax Devs
- Requires: Python >=3.11
-
Provides-Extra:
all
Classifiers
- Development Status
- Intended Audience
- License
- Operating System
- Programming Language
- Topic
- Typing
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.22.1.tar.gz
.
File metadata
- Download URL: coordinax-0.22.1.tar.gz
- Upload date:
- Size: 707.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
8d9cb60db3ffb40a934d751adce9859b62bbf92b531ed13480e009f100383059
|
|
MD5 |
20b6adc4dd10612d7b6b5a84f8242902
|
|
BLAKE2b-256 |
bf97fb1517e0d00d34b841847037d9397bc8806cd78aa1dd66334a9a8d87b15a
|
Provenance
The following attestation bundles were made for coordinax-0.22.1.tar.gz
:
Publisher:
cd.yml
on GalacticDynamics/coordinax
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1
-
Predicate type:
https://docs.pypi.org/attestations/publish/v1
-
Subject name:
coordinax-0.22.1.tar.gz
-
Subject digest:
8d9cb60db3ffb40a934d751adce9859b62bbf92b531ed13480e009f100383059
- Sigstore transparency entry: 227395165
- Sigstore integration time:
-
Permalink:
GalacticDynamics/coordinax@4ed8885e08b9342d6e470b33747ea570c129c0f0
-
Branch / Tag:
refs/tags/v0.22.1
- Owner: https://github.com/GalacticDynamics
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com
-
Runner Environment:
github-hosted
-
Publication workflow:
cd.yml@4ed8885e08b9342d6e470b33747ea570c129c0f0
-
Trigger Event:
release
-
Statement type:
File details
Details for the file coordinax-0.22.1-py3-none-any.whl
.
File metadata
- Download URL: coordinax-0.22.1-py3-none-any.whl
- Upload date:
- Size: 196.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
568cab8cc704cadfc76adc925e10ebf512f6c68817414be42e41622993e869a3
|
|
MD5 |
4baf3fb3995b32b55a8d83cf9facc9a7
|
|
BLAKE2b-256 |
ac47306d44827a70dfc030a03689b668aa28b9136847a4703816bb6795831831
|
Provenance
The following attestation bundles were made for coordinax-0.22.1-py3-none-any.whl
:
Publisher:
cd.yml
on GalacticDynamics/coordinax
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1
-
Predicate type:
https://docs.pypi.org/attestations/publish/v1
-
Subject name:
coordinax-0.22.1-py3-none-any.whl
-
Subject digest:
568cab8cc704cadfc76adc925e10ebf512f6c68817414be42e41622993e869a3
- Sigstore transparency entry: 227395168
- Sigstore integration time:
-
Permalink:
GalacticDynamics/coordinax@4ed8885e08b9342d6e470b33747ea570c129c0f0
-
Branch / Tag:
refs/tags/v0.22.1
- Owner: https://github.com/GalacticDynamics
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com
-
Runner Environment:
github-hosted
-
Publication workflow:
cd.yml@4ed8885e08b9342d6e470b33747ea570c129c0f0
-
Trigger Event:
release
-
Statement type: