Right Ascension / Declination Coordinates¶
Functions for converting between right ascension/declination (RA/Dec) and Cartesian inertial coordinates, propagating catalog positions with proper motion, and converting between topocentric RA/Dec and azimuth-elevation.
Position Conversions¶
position_radec_to_inertial builtin ¶
position_radec_to_inertial(x_radec: Union[ndarray, Sequence], angle_format: AngleFormat, axis: int = -1) -> ndarray
Convert a right ascension, declination, and range into the equivalent Cartesian inertial position.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x_radec | ndarray or list | Right ascension, declination, and range | required |
angle_format | AngleFormat | Angle format for angular elements ( | required |
axis | int | The axis of | -1 |
Returns:
| Type | Description |
|---|---|
ndarray | numpy.ndarray: Cartesian inertial position |
position_inertial_to_radec builtin ¶
position_inertial_to_radec(x_inertial: Union[ndarray, Sequence], angle_format: AngleFormat, axis: int = -1) -> ndarray
Convert a Cartesian inertial position into the equivalent right ascension, declination, and range.
Right ascension is normalized to the range [0, 360) degrees (or [0, 2*pi) radians). At the polar singularity (x = y = 0) right ascension is indeterminate from position alone and is returned as 0; use state_inertial_to_radec to resolve it from velocity instead.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x_inertial | ndarray or list | Cartesian inertial position | required |
angle_format | AngleFormat | Angle format for angular output ( | required |
axis | int | The axis of | -1 |
Returns:
| Type | Description |
|---|---|
ndarray | numpy.ndarray: Right ascension, declination, and range |
State Conversions¶
state_radec_to_inertial builtin ¶
state_radec_to_inertial(x_radec: Union[ndarray, Sequence], angle_format: AngleFormat, axis: int = -1) -> ndarray
Convert a right ascension, declination, range, and their rates into the equivalent Cartesian inertial position and velocity.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x_radec | ndarray or list | Right ascension, declination, range, and rates | required |
angle_format | AngleFormat | Angle format for angular elements and rates ( | required |
axis | int | The axis of | -1 |
Returns:
| Type | Description |
|---|---|
ndarray | numpy.ndarray: Cartesian inertial position and velocity |
state_inertial_to_radec builtin ¶
state_inertial_to_radec(x_inertial: Union[ndarray, Sequence], angle_format: AngleFormat, axis: int = -1) -> ndarray
Convert a Cartesian inertial position and velocity into the equivalent right ascension, declination, range, and their rates.
Right ascension is normalized to the range [0, 360) degrees (or [0, 2*pi) radians). At the polar singularity (x = y = 0), where right ascension is indeterminate from position alone, it is instead resolved from the velocity components.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x_inertial | ndarray or list | Cartesian inertial position and velocity | required |
angle_format | AngleFormat | Angle format for angular output and rates ( | required |
axis | int | The axis of | -1 |
Returns:
| Type | Description |
|---|---|
ndarray | numpy.ndarray: Right ascension, declination, range, and rates |
Proper Motion¶
apply_proper_motion builtin ¶
apply_proper_motion(ra: float, dec: float, pm_ra: float, pm_dec: float, parallax: Union[float, None], radial_velocity: Union[float, None], epoch_from: Epoch, epoch_to: Epoch, angle_format: AngleFormat) -> tuple[float, float]
Propagate a star's catalog position from one epoch to another using IAU SOFA's iauPmsafe space-motion transformation.
iauPmsafe reconstructs the star's full barycentric position/velocity state from the catalog (ra, dec), proper motion, parallax, and radial velocity; advances it assuming straight-line motion at constant velocity (including a light-time correction and the special-relativistic Doppler treatment of Stumpff, 1985); and reduces the result back to catalog (ra, dec) at epoch_to. To first order this is the rigorous direction-only epoch transformation of ESA SP-1200 (Vol. 1, §1.5.5): a tangential proper-motion displacement plus a radial "perspective acceleration" term that is significant for high radial-velocity, high-parallax stars such as Barnard's Star.
pm_ra follows the standard catalog convention: it is mu_alpha* = mu_alpha * cos(dec), not the raw coordinate rate mu_alpha. This matches the pmra/pmdec columns of Hipparcos, Gaia, and most other star catalogs. If parallax or radial_velocity is None it is treated as zero; iauPmsafe additionally applies a proper-motion-scaled minimum-parallax guard so a star with a missing or tiny parallax still propagates correctly rather than being clamped to a no-op.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ra | float | Right ascension at | required |
dec | float | Declination at | required |
pm_ra | float | Proper motion in right ascension, mu_alpha* = mu_alpha * cos(dec). Units: (mas/yr) | required |
pm_dec | float | Proper motion in declination, mu_delta. Units: (mas/yr) | required |
parallax | float or None | Annual parallax, or | required |
radial_velocity | float or None | Radial velocity, or | required |
epoch_from | Epoch | Epoch of the input | required |
epoch_to | Epoch | Epoch to propagate the position to. | required |
angle_format | AngleFormat | Angle format for | required |
Returns:
| Type | Description |
|---|---|
tuple[float, float] | tuple[float, float]: Right ascension and declination propagated to |
Example
Azimuth-Elevation Conversions¶
position_radec_to_azel builtin ¶
position_radec_to_azel(x_radec: Union[ndarray, Sequence], site_geodetic: Union[ndarray, Sequence], epc: Union[Epoch, Sequence[Epoch]], angle_format: AngleFormat, axis: int = -1) -> ndarray
Convert a topocentric right ascension, declination, and range into the equivalent azimuth, elevation, and range as seen from a given site.
This is a direction-only rotation of the line-of-sight unit vector: no parallax translation between the geocenter and the site is applied, and range passes through unchanged. The input (ra, dec) must already be the direction from the site: for stars (effectively at infinite distance) this is the same as the geocentric catalog (ra, dec), but for satellites or other nearby objects the caller must first compute the topocentric right ascension/declination before calling this function.
Requires a global Earth orientation parameter (EOP) provider to be initialized, as with all frame conversions between inertial and Earth-fixed frames.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x_radec | ndarray or list | Topocentric right ascension, declination, and range | required |
site_geodetic | ndarray or list | Geodetic coordinates of the observing site | required |
epc | Epoch or Sequence[Epoch] | Epoch of the observation, used to rotate between the inertial and Earth-fixed frames. A sequence evaluates one epoch per vector (or broadcasts a single vector across all epochs). | required |
angle_format | AngleFormat | Angle format for angular elements ( | required |
axis | int | The axis of | -1 |
Returns:
| Type | Description |
|---|---|
ndarray | numpy.ndarray: Azimuth (clockwise from North), elevation, and range |
Example
position_azel_to_radec builtin ¶
position_azel_to_radec(x_azel: Union[ndarray, Sequence], site_geodetic: Union[ndarray, Sequence], epc: Union[Epoch, Sequence[Epoch]], angle_format: AngleFormat, axis: int = -1) -> ndarray
Convert an azimuth, elevation, and range as seen from a given site into the equivalent topocentric right ascension, declination, and range.
This is the inverse of position_radec_to_azel and is likewise a direction-only rotation: no parallax translation between the site and the geocenter is applied, and range passes through unchanged. The returned (ra, dec) is the topocentric direction as seen from the site, which for stars is the same as the geocentric catalog (ra, dec).
Requires a global Earth orientation parameter (EOP) provider to be initialized, as with all frame conversions between inertial and Earth-fixed frames.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x_azel | ndarray or list | Azimuth (clockwise from North), elevation, and range | required |
site_geodetic | ndarray or list | Geodetic coordinates of the observing site | required |
epc | Epoch or Sequence[Epoch] | Epoch of the observation, used to rotate between the Earth-fixed and inertial frames. A sequence evaluates one epoch per vector (or broadcasts a single vector across all epochs). | required |
angle_format | AngleFormat | Angle format for angular elements ( | required |
axis | int | The axis of | -1 |
Returns:
| Type | Description |
|---|---|
ndarray | numpy.ndarray: Topocentric right ascension, declination, and range |
Example
See Also¶
- RA/Dec Transformations - Overview, equations, and usage guide
- Topocentric Coordinates API Reference - ENZ/SEZ and azimuth-elevation functions
- Cartesian Coordinates API Reference - Orbital element and Cartesian state conversions
- Star Catalogs - Catalog records that use these conversions internally