Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ jobs:
run: uv python install ${{ matrix.python-version }}

- name: Install the project
run: uv sync --group test
run: uv sync --all-packages --group test --active

- name: Test package
run: >-
uv run pytest -ra --cov --cov-report=xml --cov-report=term
uv run --frozen pytest --cov --cov-report=xml --cov-report=term
--durations=20 --arraydiff -m"not slow"

- name: Upload coverage report
Expand Down Expand Up @@ -108,8 +108,8 @@ jobs:

- name: Test package
run: >-
uv run pytest -ra --cov --cov-report=xml --cov-report=term
--durations=20
uv run --active --frozen pytest --cov --cov-report=xml
--cov-report=term --durations=20

- name: Upload coverage report
uses: codecov/codecov-action@v5.4.3
Expand Down
20 changes: 17 additions & 3 deletions docs/guides/coordinates_and_frames.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,31 @@

## Built-in Frames

{mod}`coordinax.frames` includes several standard astronomical frames:
`coordinax.frames` includes several standard frames:

```{code-block} python
>>> import coordinax.frames as cxf
>>> icrs = cxf.ICRS()

>>> alice = cxf.Alice()
>>> alice
Alice()

>>> bob = cxf.Bob()
>>> bob
Bob()
```

`coordinax_astro` includes several standard astronomical frames:

```{code-block} python
>>> from coordinax_astro import ICRS, Galactocentric
>>> icrs = ICRS()

Check failure on line 28 in docs/guides/coordinates_and_frames.md

View workflow job for this annotation

GitHub Actions / Check Python 3.12 on macos-latest

coordinates_and_frames.md line=27 column=1

Check failure on line 28 in docs/guides/coordinates_and_frames.md

View workflow job for this annotation

GitHub Actions / Check Python 3.11 on macos-latest

coordinates_and_frames.md line=27 column=1

Check failure on line 28 in docs/guides/coordinates_and_frames.md

View workflow job for this annotation

GitHub Actions / Check Python 3.13 on macos-latest

coordinates_and_frames.md line=27 column=1

Check failure on line 28 in docs/guides/coordinates_and_frames.md

View workflow job for this annotation

GitHub Actions / Check Python 3.13 on ubuntu-latest

coordinates_and_frames.md line=27 column=1

Check failure on line 28 in docs/guides/coordinates_and_frames.md

View workflow job for this annotation

GitHub Actions / Check Python 3.12 on ubuntu-latest

coordinates_and_frames.md line=27 column=1

Check failure on line 28 in docs/guides/coordinates_and_frames.md

View workflow job for this annotation

GitHub Actions / Check Oldest Dependencies (3.11, ubuntu-latest)

coordinates_and_frames.md line=27 column=1

Check failure on line 28 in docs/guides/coordinates_and_frames.md

View workflow job for this annotation

GitHub Actions / Check Python 3.11 on ubuntu-latest

coordinates_and_frames.md line=27 column=1
>>> icrs

Check failure on line 29 in docs/guides/coordinates_and_frames.md

View workflow job for this annotation

GitHub Actions / Check Python 3.12 on macos-latest

coordinates_and_frames.md line=28 column=1

Check failure on line 29 in docs/guides/coordinates_and_frames.md

View workflow job for this annotation

GitHub Actions / Check Python 3.11 on macos-latest

coordinates_and_frames.md line=28 column=1

Check failure on line 29 in docs/guides/coordinates_and_frames.md

View workflow job for this annotation

GitHub Actions / Check Python 3.13 on macos-latest

coordinates_and_frames.md line=28 column=1

Check failure on line 29 in docs/guides/coordinates_and_frames.md

View workflow job for this annotation

GitHub Actions / Check Python 3.13 on ubuntu-latest

coordinates_and_frames.md line=28 column=1

Check failure on line 29 in docs/guides/coordinates_and_frames.md

View workflow job for this annotation

GitHub Actions / Check Python 3.12 on ubuntu-latest

coordinates_and_frames.md line=28 column=1

Check failure on line 29 in docs/guides/coordinates_and_frames.md

View workflow job for this annotation

GitHub Actions / Check Oldest Dependencies (3.11, ubuntu-latest)

coordinates_and_frames.md line=28 column=1

Check failure on line 29 in docs/guides/coordinates_and_frames.md

View workflow job for this annotation

GitHub Actions / Check Python 3.11 on ubuntu-latest

coordinates_and_frames.md line=28 column=1
ICRS()

Check failure on line 30 in docs/guides/coordinates_and_frames.md

View workflow job for this annotation

GitHub Actions / Check Python 3.12 on macos-latest

coordinates_and_frames.md line=29 column=1

Check failure on line 30 in docs/guides/coordinates_and_frames.md

View workflow job for this annotation

GitHub Actions / Check Python 3.11 on macos-latest

coordinates_and_frames.md line=29 column=1

Check failure on line 30 in docs/guides/coordinates_and_frames.md

View workflow job for this annotation

GitHub Actions / Check Python 3.13 on macos-latest

coordinates_and_frames.md line=29 column=1

Check failure on line 30 in docs/guides/coordinates_and_frames.md

View workflow job for this annotation

GitHub Actions / Check Python 3.13 on ubuntu-latest

coordinates_and_frames.md line=29 column=1

Check failure on line 30 in docs/guides/coordinates_and_frames.md

View workflow job for this annotation

GitHub Actions / Check Python 3.12 on ubuntu-latest

coordinates_and_frames.md line=29 column=1

Check failure on line 30 in docs/guides/coordinates_and_frames.md

View workflow job for this annotation

GitHub Actions / Check Oldest Dependencies (3.11, ubuntu-latest)

coordinates_and_frames.md line=29 column=1

Check failure on line 30 in docs/guides/coordinates_and_frames.md

View workflow job for this annotation

GitHub Actions / Check Python 3.11 on ubuntu-latest

coordinates_and_frames.md line=29 column=1

>>> gc = cxf.Galactocentric()
>>> gc = Galactocentric()
>>> gc

Check failure on line 33 in docs/guides/coordinates_and_frames.md

View workflow job for this annotation

GitHub Actions / Check Python 3.12 on macos-latest

coordinates_and_frames.md line=32 column=1

Check failure on line 33 in docs/guides/coordinates_and_frames.md

View workflow job for this annotation

GitHub Actions / Check Python 3.11 on macos-latest

coordinates_and_frames.md line=32 column=1

Check failure on line 33 in docs/guides/coordinates_and_frames.md

View workflow job for this annotation

GitHub Actions / Check Python 3.13 on macos-latest

coordinates_and_frames.md line=32 column=1

Check failure on line 33 in docs/guides/coordinates_and_frames.md

View workflow job for this annotation

GitHub Actions / Check Python 3.13 on ubuntu-latest

coordinates_and_frames.md line=32 column=1

Check failure on line 33 in docs/guides/coordinates_and_frames.md

View workflow job for this annotation

GitHub Actions / Check Python 3.12 on ubuntu-latest

coordinates_and_frames.md line=32 column=1

Check failure on line 33 in docs/guides/coordinates_and_frames.md

View workflow job for this annotation

GitHub Actions / Check Python 3.11 on ubuntu-latest

coordinates_and_frames.md line=32 column=1
Galactocentric(

Check failure on line 34 in docs/guides/coordinates_and_frames.md

View workflow job for this annotation

GitHub Actions / Check Python 3.12 on macos-latest

coordinates_and_frames.md line=33 column=1

Check failure on line 34 in docs/guides/coordinates_and_frames.md

View workflow job for this annotation

GitHub Actions / Check Python 3.11 on macos-latest

coordinates_and_frames.md line=33 column=1

Check failure on line 34 in docs/guides/coordinates_and_frames.md

View workflow job for this annotation

GitHub Actions / Check Python 3.13 on macos-latest

coordinates_and_frames.md line=33 column=1

Check failure on line 34 in docs/guides/coordinates_and_frames.md

View workflow job for this annotation

GitHub Actions / Check Python 3.13 on ubuntu-latest

coordinates_and_frames.md line=33 column=1

Check failure on line 34 in docs/guides/coordinates_and_frames.md

View workflow job for this annotation

GitHub Actions / Check Python 3.12 on ubuntu-latest

coordinates_and_frames.md line=33 column=1

Check failure on line 34 in docs/guides/coordinates_and_frames.md

View workflow job for this annotation

GitHub Actions / Check Python 3.11 on ubuntu-latest

coordinates_and_frames.md line=33 column=1
galcen=LonLatSphericalPos(...),
roll=Quantity(...),
z_sun=Quantity(...),
Expand All @@ -34,8 +48,8 @@
>>> import coordinax.vecs as cxv
>>> q = cxv.CartesianPos3D.from_([1, 2, 3], "kpc")
>>> coord = cxf.Coordinate(q, frame=icrs)
>>> print(coord)

Check failure on line 51 in docs/guides/coordinates_and_frames.md

View workflow job for this annotation

GitHub Actions / Check Python 3.12 on macos-latest

coordinates_and_frames.md line=50 column=1

Check failure on line 51 in docs/guides/coordinates_and_frames.md

View workflow job for this annotation

GitHub Actions / Check Python 3.11 on macos-latest

coordinates_and_frames.md line=50 column=1

Check failure on line 51 in docs/guides/coordinates_and_frames.md

View workflow job for this annotation

GitHub Actions / Check Python 3.13 on macos-latest

coordinates_and_frames.md line=50 column=1

Check failure on line 51 in docs/guides/coordinates_and_frames.md

View workflow job for this annotation

GitHub Actions / Check Python 3.13 on ubuntu-latest

coordinates_and_frames.md line=50 column=1

Check failure on line 51 in docs/guides/coordinates_and_frames.md

View workflow job for this annotation

GitHub Actions / Check Python 3.12 on ubuntu-latest

coordinates_and_frames.md line=50 column=1

Check failure on line 51 in docs/guides/coordinates_and_frames.md

View workflow job for this annotation

GitHub Actions / Check Python 3.11 on ubuntu-latest

coordinates_and_frames.md line=50 column=1
Coordinate(

Check failure on line 52 in docs/guides/coordinates_and_frames.md

View workflow job for this annotation

GitHub Actions / Check Python 3.12 on macos-latest

coordinates_and_frames.md line=51 column=1

Check failure on line 52 in docs/guides/coordinates_and_frames.md

View workflow job for this annotation

GitHub Actions / Check Python 3.11 on macos-latest

coordinates_and_frames.md line=51 column=1

Check failure on line 52 in docs/guides/coordinates_and_frames.md

View workflow job for this annotation

GitHub Actions / Check Python 3.13 on macos-latest

coordinates_and_frames.md line=51 column=1

Check failure on line 52 in docs/guides/coordinates_and_frames.md

View workflow job for this annotation

GitHub Actions / Check Python 3.13 on ubuntu-latest

coordinates_and_frames.md line=51 column=1

Check failure on line 52 in docs/guides/coordinates_and_frames.md

View workflow job for this annotation

GitHub Actions / Check Python 3.12 on ubuntu-latest

coordinates_and_frames.md line=51 column=1

Check failure on line 52 in docs/guides/coordinates_and_frames.md

View workflow job for this annotation

GitHub Actions / Check Python 3.11 on ubuntu-latest

coordinates_and_frames.md line=51 column=1
{
'length': <CartesianPos3D: (x, y, z) [kpc]
[1 2 3]>
Expand All @@ -54,9 +68,9 @@

```{code-block} python
>>> op = cxf.frame_transform_op(icrs, gc)
>>> q_gc = op(q)

Check failure on line 71 in docs/guides/coordinates_and_frames.md

View workflow job for this annotation

GitHub Actions / Check Python 3.12 on macos-latest

coordinates_and_frames.md line=70 column=1

Check failure on line 71 in docs/guides/coordinates_and_frames.md

View workflow job for this annotation

GitHub Actions / Check Python 3.11 on macos-latest

coordinates_and_frames.md line=70 column=1

Check failure on line 71 in docs/guides/coordinates_and_frames.md

View workflow job for this annotation

GitHub Actions / Check Python 3.13 on macos-latest

coordinates_and_frames.md line=70 column=1

Check failure on line 71 in docs/guides/coordinates_and_frames.md

View workflow job for this annotation

GitHub Actions / Check Python 3.13 on ubuntu-latest

coordinates_and_frames.md line=70 column=1

Check failure on line 71 in docs/guides/coordinates_and_frames.md

View workflow job for this annotation

GitHub Actions / Check Python 3.12 on ubuntu-latest

coordinates_and_frames.md line=70 column=1

Check failure on line 71 in docs/guides/coordinates_and_frames.md

View workflow job for this annotation

GitHub Actions / Check Python 3.11 on ubuntu-latest

coordinates_and_frames.md line=70 column=1
>>> print(q_gc)

Check failure on line 72 in docs/guides/coordinates_and_frames.md

View workflow job for this annotation

GitHub Actions / Check Python 3.12 on macos-latest

coordinates_and_frames.md line=71 column=1

Check failure on line 72 in docs/guides/coordinates_and_frames.md

View workflow job for this annotation

GitHub Actions / Check Python 3.11 on macos-latest

coordinates_and_frames.md line=71 column=1

Check failure on line 72 in docs/guides/coordinates_and_frames.md

View workflow job for this annotation

GitHub Actions / Check Python 3.13 on macos-latest

coordinates_and_frames.md line=71 column=1

Check failure on line 72 in docs/guides/coordinates_and_frames.md

View workflow job for this annotation

GitHub Actions / Check Python 3.13 on ubuntu-latest

coordinates_and_frames.md line=71 column=1

Check failure on line 72 in docs/guides/coordinates_and_frames.md

View workflow job for this annotation

GitHub Actions / Check Python 3.12 on ubuntu-latest

coordinates_and_frames.md line=71 column=1

Check failure on line 72 in docs/guides/coordinates_and_frames.md

View workflow job for this annotation

GitHub Actions / Check Python 3.11 on ubuntu-latest

coordinates_and_frames.md line=71 column=1
<CartesianPos3D: (x, y, z) [kpc]

Check failure on line 73 in docs/guides/coordinates_and_frames.md

View workflow job for this annotation

GitHub Actions / Check Python 3.12 on macos-latest

coordinates_and_frames.md line=72 column=1

Check failure on line 73 in docs/guides/coordinates_and_frames.md

View workflow job for this annotation

GitHub Actions / Check Python 3.11 on macos-latest

coordinates_and_frames.md line=72 column=1

Check failure on line 73 in docs/guides/coordinates_and_frames.md

View workflow job for this annotation

GitHub Actions / Check Python 3.13 on macos-latest

coordinates_and_frames.md line=72 column=1

Check failure on line 73 in docs/guides/coordinates_and_frames.md

View workflow job for this annotation

GitHub Actions / Check Python 3.13 on ubuntu-latest

coordinates_and_frames.md line=72 column=1

Check failure on line 73 in docs/guides/coordinates_and_frames.md

View workflow job for this annotation

GitHub Actions / Check Python 3.12 on ubuntu-latest

coordinates_and_frames.md line=72 column=1

Check failure on line 73 in docs/guides/coordinates_and_frames.md

View workflow job for this annotation

GitHub Actions / Check Python 3.11 on ubuntu-latest

coordinates_and_frames.md line=72 column=1
[-11.375 1.845 0.133]>

>>> coord_gc = coord.to_frame(gc)
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/vectors.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ CartesianVel3D(
{class}`~coordinax.vecs.CartesianPosND`
- Similar classes for velocities (`CartesianVel*`), accelerations
(`CartesianAcc*`), etc.
- Spacetime vectors {class}`~coordinax.vecs.FourVector`
- Spacetime vectors {class}`~coordinax_astro.FourVector`

## Conversion Between Representations

Expand Down
2 changes: 1 addition & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def docs(session: nox.Session) -> None:
if args.builder != "html" and args.serve:
session.error("Must not specify non-HTML builder with --serve")

session.run("uv", "sync", "--group", "docs", "--active")
session.run("uv", "sync", "--all-packages", "--group", "docs", "--active")
session.chdir("docs")

if args.builder == "linkcheck":
Expand Down
Empty file.
32 changes: 32 additions & 0 deletions packages/coordinax-astro/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[project]
name = "coordinax_astro"
dynamic = ["version"]
description = "Astronomical coordinates in JAX"
readme = "README.md"
license = "MIT"
requires-python = ">=3.11"
authors = [
{ name = "Coordinax Devs", email = "nstarman@users.noreply.github.com" },
{ name = "Nathaniel Starkman", email = "nstarman@users.noreply.github.com" },
{ name = "Adrian Price-Whelan", email = "adrn@users.noreply.github.com" },
]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Science/Research",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Scientific/Engineering",
"Typing :: Typed",
]
dependencies = [
"coordinax",
]

[tool.uv.sources]
coordinax = { workspace = true }
30 changes: 30 additions & 0 deletions packages/coordinax-astro/src/coordinax_astro/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"""Coordinax for Astronomy.

>>> import unxt as u
>>> import coordinax as cx
>>> import coordinax_astro as cxa

>>> icrs = cxa.ICRS()
>>> gcf = cxa.Galactocentric()

>>> op = cx.frames.frame_transform_op(icrs, gcf)
>>> op
Pipe(( ... ))

>>> q = cx.vecs.CartesianPos3D.from_([1, 2, 3], "kpc")
>>> print(op(q))
<CartesianPos3D: (x, y, z) [kpc]
[-11.375 1.845 0.133]>

"""

__all__ = ["FourVector", "AbstractSpaceFrame", "ICRS", "Galactocentric"]

from ._src import ICRS, AbstractSpaceFrame, FourVector, Galactocentric

# Interoperability. Importing this module will register interop frameworks.
# isort: split
from . import _interop

# clean up namespace
del _interop
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
import astropy.coordinates as apyc
import equinox as eqx

from coordinax._coordinax_space_frames import ICRS, Galactocentric
from coordinax_astro._src.frames import ICRS, Galactocentric

from coordinax._src.frames.base import AbstractReferenceFrame
from coordinax._src.vectors.d3 import LonLatSphericalPos

Expand All @@ -17,10 +18,10 @@ def from_(cls: type[ICRS], obj: apyc.ICRS, /) -> ICRS:
Examples
--------
>>> import astropy.coordinates as apyc
>>> import coordinax.frames as cxf
>>> from coordinax_astro import ICRS

>>> apy_icrs = apyc.ICRS()
>>> cxf.ICRS.from_(apy_icrs)
>>> ICRS.from_(apy_icrs)
ICRS()

"""
Expand All @@ -35,14 +36,14 @@ def from_(cls: type[Galactocentric], obj: apyc.Galactocentric, /) -> Galactocent
Examples
--------
>>> import astropy.coordinates as apyc
>>> import coordinax.frames as cxf
>>> from coordinax_astro import Galactocentric

>>> apy_gcf = apyc.Galactocentric()
>>> apy_gcf
<Galactocentric Frame (galcen_coord=<ICRS Coordinate: (ra, dec) in deg
(266.4051, -28.936175)>, galcen_distance=8.122 kpc, galcen_v_sun=(12.9, 245.6, 7.78) km / s, z_sun=20.8 pc, roll=0.0 deg)>

>>> gcf = cxf.Galactocentric.from_(apy_gcf)
>>> gcf = Galactocentric.from_(apy_gcf)
>>> gcf
Galactocentric(
galcen=LonLatSphericalPos( ... ),
Expand All @@ -58,7 +59,6 @@ def from_(cls: type[Galactocentric], obj: apyc.Galactocentric, /) -> Galactocent
... and gcf.galcen.distance.ustrip("kpc") == apy_gcf.galcen_distance.to_value("kpc") )
Array(True, dtype=bool)


""" # noqa: E501
obj = eqx.error_if(obj, obj.has_data, "Astropy frame must not have data.")
galcen = LonLatSphericalPos(
Expand Down
6 changes: 6 additions & 0 deletions packages/coordinax-astro/src/coordinax_astro/_src/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
"""Coordinax for Astronomy."""

__all__ = ["FourVector", "AbstractSpaceFrame", "ICRS", "Galactocentric"]

from .frames import ICRS, AbstractSpaceFrame, Galactocentric
from .vecs import FourVector
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,3 @@
from .frame_transforms import *
from .galactocentric import Galactocentric
from .icrs import ICRS

# Interoperability. Importing this module will register interop frameworks.
# isort: split
from . import _interop

# clean up namespace
del _interop
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ def frame_transform_op(
>>> from plum import dispatch
>>> import unxt as u
>>> import coordinax as cx
>>> from coordinax_astro import AbstractSpaceFrame, ICRS, Galactocentric

>>> class MySpaceFrame(cx.frames.AbstractSpaceFrame):
>>> class MySpaceFrame(AbstractSpaceFrame):
... pass

>>> @dispatch
Expand All @@ -61,7 +62,7 @@ def frame_transform_op(
we don't have a direct transformation defined:

>>> my_frame = MySpaceFrame()
>>> gcf_frame = cx.frames.Galactocentric()
>>> gcf_frame = Galactocentric()

>>> op = cx.frames.frame_transform_op(my_frame, gcf_frame)
>>> op
Expand All @@ -87,8 +88,8 @@ def frame_transform_op(from_frame: ICRS, to_frame: ICRS, /) -> Identity:
Examples
--------
>>> import coordinax.frames as cxf
>>> icrs_frame = cxf.ICRS()
>>> frame_op = cxf.frame_transform_op(icrs_frame, icrs_frame)
>>> alice = cxf.Alice()
>>> frame_op = cxf.frame_transform_op(alice, alice)
>>> frame_op
Identity()

Expand All @@ -107,13 +108,14 @@ def frame_transform_op(from_frame: Galactocentric, to_frame: Galactocentric, /)
--------
>>> import unxt as u
>>> import coordinax.frames as cxf
>>> from coordinax_astro import Galactocentric

>>> gcf_frame = cxf.Galactocentric()
>>> gcf_frame = Galactocentric()
>>> frame_op = cxf.frame_transform_op(gcf_frame, gcf_frame)
>>> frame_op
Pipe(Identity())

>>> gcf_frame2 = cxf.Galactocentric(roll=u.Quantity(10, "deg"))
>>> gcf_frame2 = Galactocentric(roll=u.Quantity(10, "deg"))
>>> frame_op2 = cxf.frame_transform_op(gcf_frame, gcf_frame2)
>>> frame_op2
Pipe((
Expand Down Expand Up @@ -151,6 +153,7 @@ def frame_transform_op(from_frame: ICRS, to_frame: Galactocentric, /) -> Pipe:

>>> import unxt as u
>>> import coordinax as cx
>>> from coordinax_astro import Galactocentric, ICRS
>>> import astropy.coordinates as apyc

The location of Vega in ICRS coordinates:
Expand Down Expand Up @@ -186,8 +189,8 @@ def frame_transform_op(from_frame: ICRS, to_frame: Galactocentric, /) -> Pipe:
>>> vega_q = cx.vecs.LonLatSphericalPos.from_(vega.icrs.data)
>>> vega_p = cx.vecs.LonCosLatSphericalVel.from_(vega.icrs.data.differentials["s"])

>>> icrs_frame = cx.frames.ICRS()
>>> gcf_frame = cx.frames.Galactocentric.from_(apy_gcf)
>>> icrs_frame = ICRS()
>>> gcf_frame = Galactocentric.from_(apy_gcf)

Define the transformation operator:

Expand Down Expand Up @@ -277,6 +280,7 @@ def frame_transform_op(from_frame: Galactocentric, to_frame: ICRS, /) -> Pipe:

>>> import unxt as u
>>> import coordinax as cx
>>> from coordinax_astro import Galactocentric, ICRS
>>> import astropy.coordinates as apyc

The location of Vega in Galactocentric coordinates:
Expand Down Expand Up @@ -313,8 +317,8 @@ def frame_transform_op(from_frame: Galactocentric, to_frame: ICRS, /) -> Pipe:
>>> vega_q = cx.CartesianPos3D.from_(vega.galactocentric.data)
>>> vega_p = cx.CartesianVel3D.from_(vega.galactocentric.data.differentials["s"])

>>> icrs_frame = cx.frames.ICRS()
>>> gcf_frame = cx.frames.Galactocentric.from_(apy_gcf)
>>> icrs_frame = ICRS()
>>> gcf_frame = Galactocentric.from_(apy_gcf)

Define the transformation operator:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ class Galactocentric(AbstractSpaceFrame):

Examples
--------
>>> import coordinax as cx
>>> frame = cx.frames.Galactocentric()
>>> frame
>>> from coordinax_astro import Galactocentric
>>> Galactocentric()
Galactocentric(
galcen=LonLatSphericalPos( ... ),
roll=Quantity(weak_i32[], unit='deg'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ class ICRS(AbstractSpaceFrame):

Examples
--------
>>> import coordinax as cx
>>> frame = cx.frames.ICRS()
>>> frame
>>> from coordinax_astro import ICRS

>>> ICRS()
ICRS()

"""
15 changes: 15 additions & 0 deletions packages/coordinax-astro/src/coordinax_astro/_src/vecs/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
"""Frames for Astronomy."""

__all__ = [
"FourVector",
]

from .spacetime import FourVector

# Register by importing
# isort: split
from . import (
register_convert, # noqa: F401
register_primitives, # noqa: F401
register_vectorapi, # noqa: F401
)
Loading
Loading