11"""Astronomy reference frames."""
22# ruff:noqa: N806
33
4- __all__ : list [str ] = []
4+ __all__ : tuple [str , ... ] = ()
55
66
77from typing import TypeAlias
1616from .galactocentric import Galactocentric
1717from .icrs import ICRS
1818from coordinax ._src .distances import Distance
19- from coordinax ._src .operators import (
20- GalileanRotation ,
21- GalileanSpatialTranslation ,
22- Identity ,
23- Pipe ,
24- VelocityBoost ,
25- simplify_op ,
26- )
19+ from coordinax ._src .operators import Identity , Pipe , Rotate , Translate , simplify_op
2720
2821ScalarAngle : TypeAlias = Shaped [u .Quantity ["angle" ] | u .Angle , "" ]
29- RotationMatrix : TypeAlias = Shaped [Array , "3 3" ]
22+ RotateMatrix : TypeAlias = Shaped [Array , "3 3" ]
3023LengthVector : TypeAlias = Shaped [u .Quantity ["length" ], "3" ] | Shaped [Distance , "3" ]
3124VelocityVector : TypeAlias = Shaped [u .Quantity ["speed" ], "3" ]
3225
@@ -54,7 +47,7 @@ def frame_transform_op(
5447
5548 >>> @dispatch
5649 ... def frame_transform_op(from_frame: MySpaceFrame, to_frame: ICRS, /) -> cx.ops.AbstractOperator:
57- ... return cx.ops.GalileanRotation .from_euler("z", u.Quantity(10, "deg"))
50+ ... return cx.ops.Rotate .from_euler("z", u.Quantity(10, "deg"))
5851
5952 We can transform from `MySpaceFrame` to a Galacocentric frame, even though
6053 we don't have a direct transformation defined:
@@ -65,7 +58,7 @@ def frame_transform_op(
6558 >>> op = cx.frames.frame_transform_op(my_frame, gcf_frame)
6659 >>> op
6760 Pipe((
68- GalileanRotation (rotation=f32[3,3]),
61+ Rotate (rotation=f32[3,3]),
6962 ...
7063 ))
7164
@@ -116,14 +109,14 @@ def frame_transform_op(from_frame: Galactocentric, to_frame: Galactocentric, /)
116109 >>> frame_op2 = cxf.frame_transform_op(gcf_frame, gcf_frame2)
117110 >>> frame_op2
118111 Pipe((
119- VelocityBoost (CartesianVel3D( ... )),
120- GalileanRotation (rotation=f32[3,3]),
121- GalileanSpatialTranslation (CartesianPos3D( ... )),
122- GalileanRotation (rotation=f32[3,3]),
123- GalileanRotation (rotation=f32[3,3]),
124- GalileanSpatialTranslation (CartesianPos3D( ... )),
125- GalileanRotation (rotation=f32[3,3]),
126- VelocityBoost (CartesianVel3D( ... ))
112+ Translate (CartesianVel3D( ... )),
113+ Rotate (rotation=f32[3,3]),
114+ Translate (CartesianPos3D( ... )),
115+ Rotate (rotation=f32[3,3]),
116+ Rotate (rotation=f32[3,3]),
117+ Translate (CartesianPos3D( ... )),
118+ Rotate (rotation=f32[3,3]),
119+ Translate (CartesianVel3D( ... ))
127120 ))
128121
129122 """
@@ -193,10 +186,10 @@ def frame_transform_op(from_frame: ICRS, to_frame: Galactocentric, /) -> Pipe:
193186 >>> frame_op = cx.frames.frame_transform_op(icrs_frame, gcf_frame)
194187 >>> frame_op
195188 Pipe((
196- GalileanRotation (rotation=f32[3,3]),
197- GalileanSpatialTranslation (CartesianPos3D( ... )),
198- GalileanRotation (rotation=f32[3,3]),
199- VelocityBoost (CartesianVel3D( ... ))
189+ Rotate (rotation=f32[3,3]),
190+ Translate (CartesianPos3D( ... )),
191+ Rotate (rotation=f32[3,3]),
192+ Translate (CartesianVel3D( ... ))
200193 ))
201194
202195 Apply the transformation:
@@ -238,25 +231,23 @@ def frame_transform_op(from_frame: ICRS, to_frame: Galactocentric, /) -> Pipe:
238231
239232 """ # noqa: E501
240233 # rotation matrix to align x(ICRS) with the vector to the Galactic center
241- rot_lat = GalileanRotation .from_euler ("y" , to_frame .galcen .lat )
242- rot_lon = GalileanRotation .from_euler ("z" , - to_frame .galcen .lon )
234+ rot_lat = Rotate .from_euler ("y" , to_frame .galcen .lat )
235+ rot_lon = Rotate .from_euler ("z" , - to_frame .galcen .lon )
243236 # extra roll away from the Galactic x-z plane
244- roll = GalileanRotation .from_euler ("x" , to_frame .roll - to_frame .roll0 )
237+ roll = Rotate .from_euler ("x" , to_frame .roll - to_frame .roll0 )
245238 # construct transformation matrix
246239 R = (roll @ rot_lat @ rot_lon ).simplify ()
247240
248241 # Translation by Sun-Galactic center distance around x' and rotate about y'
249242 # to account for tilt due to Sun's height above the plane
250243 z_d = u .ustrip ("" , to_frame .z_sun / to_frame .galcen .distance ) # [radian]
251- H = GalileanRotation .from_euler ("y" , u .Quantity (jnp .asin (z_d ), "rad" ))
244+ H = Rotate .from_euler ("y" , u .Quantity (jnp .asin (z_d ), "rad" ))
252245
253246 # Post-rotation spatial offset to Galactic center.
254- offset_q = GalileanSpatialTranslation (
255- - to_frame .galcen .distance * jnp .asarray ([1 , 0 , 0 ])
256- )
247+ offset_q = Translate (- to_frame .galcen .distance * jnp .asarray ([1 , 0 , 0 ]))
257248
258249 # Post-rotation velocity offset
259- offset_v = VelocityBoost (to_frame .galcen_v_sun )
250+ offset_v = Translate (to_frame .galcen_v_sun )
260251
261252 # Total Operator
262253 return R | offset_q | H | offset_v
0 commit comments