Skip to content

true_geoecliptic_to_gcrs bypasses erfa_astrom science state, calls ERFA routines directly #20415

Description

@lpsinger

Description

The following code is unexpectedly slow because the ecliptic transforms directly call ERFA routines rather than using the interpolation machinery:

import numpy as np
from astropy import units as u
from astropy.coordinates import GeocentricTrueEcliptic, SkyCoord
from astropy.coordinates.erfa_astrom import ErfaAstromInterpolator, erfa_astrom
from astropy.time import Time

erfa_astrom.set(ErfaAstromInterpolator(30 * u.day))

n = 1_000_000
obstime = Time("2025-01-01") + np.linspace(0, 365, n) * u.day
target_coord = SkyCoord(np.linspace(0, 360, n, endpoint=False) * u.deg, 0 * u.deg)
target_coord.transform_to(GeocentricTrueEcliptic(equinox=obstime))

Expected behavior

Should go fast!

How to Reproduce

See code sample above.

Versions

platform
--------
platform.platform() = 'macOS-26.7-arm64-arm-64bit-Mach-O'
platform.version() = 'Darwin Kernel Version 25.6.0: Tue Aug 18 17:51:35 PDT 2026; root:xnu-12377.161.15.700.19~2/RELEASE_ARM64_T6031'
platform.python_version() = '3.14.7'

packages
--------
astropy              8.0.1
numpy                2.5.3
scipy                1.18.1
matplotlib           3.11.2
pandas               --
pyerfa               2.0.1.5

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions