Python API ========== This page documents the main Python API exported by the `rust_ephem` extension module. The native extension is built with `maturin` and exposed under the module name ``rust_ephem``. Module Reference ---------------- .. automodule:: rust_ephem :members: :undoc-members: :show-inheritance: :no-index: API Overview ------------ The module exposes the following primary classes and helper functions. If the compiled extension is not available at documentation build time these names may be mocked (see `docs/README.md`). Classes ^^^^^^^ **Ephemeris** (Abstract Base Class) Common interface for all ephemeris types. All concrete ephemeris classes (TLEEphemeris, SPICEEphemeris, GroundEphemeris, OEMEphemeris, FileEphemeris, ParquetEphemeris) implement this interface and can be used interchangeably where an ``Ephemeris`` is expected. Use ``isinstance(obj, Ephemeris)`` to check if an object is any ephemeris type. **Common Properties:** * ``timestamp`` — Array of UTC timestamps * ``gcrs_pv`` — Position/velocity in GCRS frame * ``itrs_pv`` — Position/velocity in ITRS frame * ``gcrs`` — GCRS coordinates as astropy SkyCoord * ``itrs`` — ITRS coordinates as astropy SkyCoord * ``sun``, ``moon``, ``earth`` — Celestial body SkyCoord objects * ``sun_pv``, ``moon_pv`` — Celestial body position/velocity data * ``obsgeoloc``, ``obsgeovel`` — Observer location/velocity in GCRS * ``latitude_deg``, ``longitude_deg``, ``height_m`` — Geodetic coordinates * ``sun_radius_deg``, ``moon_radius_deg``, ``earth_radius_deg`` — Angular radii * ``sun_ra_dec_deg``, ``moon_ra_dec_deg``, ``earth_ra_dec_deg`` — RA/Dec as Nx2 arrays (cached) * ``sun_ra_deg``, ``sun_dec_deg``, etc. — Individual RA or Dec as 1D arrays * ``begin``, ``end``, ``step_size``, ``polar_motion`` — Time range properties **Common Methods:** * ``index(time)`` — Find closest timestamp index * ``get_body(body, spice_kernel=None, use_horizons=False)`` — Get SkyCoord for a celestial body. If ``use_horizons=True``, falls back to JPL Horizons when the body is not found in SPICE kernels. * ``get_body_pv(body, spice_kernel=None, use_horizons=False)`` — Get position/velocity for a celestial body. If ``use_horizons=True``, falls back to JPL Horizons when the body is not found in SPICE kernels. * ``moon_illumination(time_indices=None)`` — Calculate Moon illumination fraction (0.0-1.0) as seen from observer * ``radec_to_altaz(ra_deg, dec_deg, time_indices=None)`` — Convert RA/Dec to Alt/Az coordinates * ``calculate_airmass(ra_deg, dec_deg, time_indices=None)`` — Calculate astronomical airmass for target **Type Alias:** ``EphemerisType = TLEEphemeris | SPICEEphemeris | OEMEphemeris | GroundEphemeris | FileEphemeris | ParquetEphemeris`` **TLEEphemeris** Propagate Two-Line Element (TLE) sets with SGP4 and convert to coordinate frames. **Constructor:** ``TLEEphemeris(tle1=None, tle2=None, begin=None, end=None, step_size=60, *, polar_motion=False, tle=None, norad_id=None, norad_name=None, spacetrack_username=None, spacetrack_password=None, epoch_tolerance_days=None, enforce_source=None)`` **Parameters:** * ``tle1`` (str, optional) — First line of TLE (legacy method) * ``tle2`` (str, optional) — Second line of TLE (legacy method) * ``tle`` (str | TLERecord, optional) — Path to TLE file, URL to download TLE from, or a ``TLERecord`` object * ``norad_id`` (int, optional) — NORAD catalog ID to fetch TLE. If Space-Track credentials are available, Space-Track is tried first with failover to Celestrak. * ``norad_name`` (str, optional) — Satellite name to fetch TLE from Celestrak * ``begin`` (datetime) — Start time for ephemeris (required) * ``end`` (datetime) — End time for ephemeris (required) * ``step_size`` (int) — Time step in seconds (default: 60) * ``polar_motion`` (bool) — Apply polar motion corrections (default: False) * ``spacetrack_username`` (str, optional) — Space-Track.org username (or use ``SPACETRACK_USERNAME`` env var) * ``spacetrack_password`` (str, optional) — Space-Track.org password (or use ``SPACETRACK_PASSWORD`` env var) * ``epoch_tolerance_days`` (float, optional) — For Space-Track cache: how many days TLE epoch can differ from target epoch (default: 4.0 days) * ``enforce_source`` (str, optional) — Enforce use of specific source without failover. Must be ``"celestrak"``, ``"spacetrack"``, or ``None`` **Notes:** * Must provide exactly one of: (``tle1``, ``tle2``), ``tle``, ``norad_id``, or ``norad_name`` * ``begin`` and ``end`` parameters are required * File paths and URLs are cached locally for performance * Space-Track.org credentials can also be provided via ``.env`` file **Attributes (read-only):** * ``tle_epoch`` — TLE epoch as Python datetime (extracted from line 1) * ``teme_pv`` — Position/velocity in TEME frame (PositionVelocityData) * ``itrs_pv`` — Position/velocity in ITRS frame (PositionVelocityData) * ``gcrs_pv`` — Position/velocity in GCRS frame (PositionVelocityData) * ``sun_pv`` — Sun position/velocity in GCRS frame (PositionVelocityData) * ``moon_pv`` — Moon position/velocity in GCRS frame (PositionVelocityData) * ``timestamp`` — List of Python datetime objects * ``itrs`` — ITRS coordinates as astropy SkyCoord * ``gcrs`` — GCRS coordinates as astropy SkyCoord * ``latitude`` — Observatory latitude as an astropy Quantity array (degrees), one per timestamp * ``latitude_deg`` — Observatory latitude as NumPy array (degrees), one per timestamp * ``latitude_rad`` — Observatory latitude as NumPy array (radians), one per timestamp * ``longitude`` — Observatory longitude as an astropy Quantity array (degrees), one per timestamp * ``longitude_deg`` — Observatory longitude as NumPy array (degrees), one per timestamp * ``longitude_rad`` — Observatory longitude as NumPy array (radians), one per timestamp * ``height`` — Observatory height as an astropy Quantity array (meters), one per timestamp * ``height_m`` — Observatory height as raw NumPy array (meters), one per timestamp * ``height_km`` — Observatory height as raw NumPy array (kilometers), one per timestamp * ``earth`` — Earth position as astropy SkyCoord * ``sun`` — Sun position as astropy SkyCoord * ``moon`` — Moon position as astropy SkyCoord * ``obsgeoloc`` — Observer geocentric location (alias for GCRS position) * ``obsgeovel`` — Observer geocentric velocity (alias for GCRS velocity) * ``sun_radius`` — Sun angular radius as astropy Quantity (degrees) * ``sun_radius_deg`` — Sun angular radius as NumPy array (degrees) * ``sun_radius_rad`` — Sun angular radius as NumPy array (radians) * ``moon_radius`` — Moon angular radius as astropy Quantity (degrees) * ``moon_radius_deg`` — Moon angular radius as NumPy array (degrees) * ``moon_radius_rad`` — Moon angular radius as NumPy array (radians) * ``earth_radius`` — Earth angular radius as astropy Quantity (degrees) * ``earth_radius_deg`` — Earth angular radius as NumPy array (degrees) * ``earth_radius_rad`` — Earth angular radius as NumPy array (radians) * ``sun_ra_dec_deg`` — Sun RA/Dec as Nx2 NumPy array (degrees), cached * ``sun_ra_dec_rad`` — Sun RA/Dec as Nx2 NumPy array (radians), cached * ``moon_ra_dec_deg`` — Moon RA/Dec as Nx2 NumPy array (degrees), cached * ``moon_ra_dec_rad`` — Moon RA/Dec as Nx2 NumPy array (radians), cached * ``earth_ra_dec_deg`` — Earth RA/Dec as Nx2 NumPy array (degrees), cached * ``earth_ra_dec_rad`` — Earth RA/Dec as Nx2 NumPy array (radians), cached * ``sun_ra_deg``, ``sun_dec_deg`` — Sun RA and Dec as separate 1D arrays (degrees) * ``sun_ra_rad``, ``sun_dec_rad`` — Sun RA and Dec as separate 1D arrays (radians) * ``moon_ra_deg``, ``moon_dec_deg`` — Moon RA and Dec as separate 1D arrays (degrees) * ``moon_ra_rad``, ``moon_dec_rad`` — Moon RA and Dec as separate 1D arrays (radians) * ``earth_ra_deg``, ``earth_dec_deg`` — Earth RA and Dec as separate 1D arrays (degrees) * ``earth_ra_rad``, ``earth_dec_rad`` — Earth RA and Dec as separate 1D arrays (radians) **Methods:** * ``index(time)`` — Find the index of the closest timestamp to the given datetime - ``time`` — Python datetime object - Returns: ``int`` index that can be used to access ephemeris arrays - Example: ``idx = eph.index(datetime(2024, 1, 1, 12, 0, 0))`` then ``position = eph.gcrs_pv.position[idx]`` * ``get_body_pv(body)`` — Get position/velocity of a solar system body relative to observer - ``body`` — Body name (e.g., "Sun", "Moon", "Mars") or NAIF ID as string (e.g., "10", "301") - Returns: ``PositionVelocityData`` with position/velocity in GCRS frame - Requires: ``ensure_planetary_ephemeris()`` called first * ``get_body(body)`` — Get SkyCoord for a solar system body with observer location set - ``body`` — Body name or NAIF ID as string - Returns: ``astropy.coordinates.SkyCoord`` in GCRS frame with obsgeoloc/obsgeovel set - Requires: ``ensure_planetary_ephemeris()`` called first **SPICEEphemeris** Spacecraft ephemeris from SPICE SPK (Spacecraft and Planet Kernel) files. Use this for missions that provide trajectory data in SPICE format. **Constructor:** ``SPICEEphemeris(spk_path, naif_id, begin, end, step_size=60, center_id=399, *, polar_motion=False)`` * ``spk_path`` — Path to the SPICE SPK file containing spacecraft trajectory * ``naif_id`` — NAIF ID of the spacecraft (typically negative, e.g., -82 for Cassini) * ``center_id`` — NAIF ID of the observer center (default: 399 = Earth) **Attributes (read-only):** * ``gcrs_pv`` — Position/velocity in GCRS frame (PositionVelocityData) * ``itrs_pv`` — Position/velocity in ITRS frame (PositionVelocityData) * ``sun_pv`` — Sun position/velocity in GCRS frame (PositionVelocityData) * ``moon_pv`` — Moon position/velocity in GCRS frame (PositionVelocityData) * ``timestamp`` — List of Python datetime objects * ``itrs`` — ITRS coordinates as astropy SkyCoord * ``gcrs`` — GCRS coordinates as astropy SkyCoord * ``earth`` — Earth position as astropy SkyCoord * ``sun`` — Sun position as astropy SkyCoord * ``moon`` — Moon position as astropy SkyCoord * ``latitude`` — Geodetic latitude as an astropy Quantity array (degrees), one per timestamp * ``latitude_deg`` — Geodetic latitude as NumPy array (degrees), one per timestamp * ``latitude_rad`` — Geodetic latitude as NumPy array (radians), one per timestamp * ``longitude`` — Geodetic longitude as an astropy Quantity array (degrees), one per timestamp * ``longitude_deg`` — Geodetic longitude as NumPy array (degrees), one per timestamp * ``longitude_rad`` — Geodetic longitude as NumPy array (radians), one per timestamp * ``height`` — Height as an astropy Quantity array (meters), one per timestamp * ``height_m`` — Height as raw NumPy array (meters), one per timestamp * ``height_km`` — Height as raw NumPy array (kilometers), one per timestamp * ``obsgeoloc`` — Observer geocentric location (alias for GCRS position) * ``obsgeovel`` — Observer geocentric velocity (alias for GCRS velocity) * ``sun_radius`` — Sun angular radius as astropy Quantity (degrees) * ``sun_radius_deg`` — Sun angular radius as NumPy array (degrees) * ``sun_radius_rad`` — Sun angular radius as NumPy array (radians) * ``moon_radius`` — Moon angular radius as astropy Quantity (degrees) * ``moon_radius_deg`` — Moon angular radius as NumPy array (degrees) * ``moon_radius_rad`` — Moon angular radius as NumPy array (radians) * ``earth_radius`` — Earth angular radius as astropy Quantity (degrees) * ``earth_radius_deg`` — Earth angular radius as NumPy array (degrees) * ``earth_radius_rad`` — Earth angular radius as NumPy array (radians) * ``sun_ra_dec_deg`` — Sun RA/Dec as Nx2 NumPy array (degrees), cached * ``sun_ra_dec_rad`` — Sun RA/Dec as Nx2 NumPy array (radians), cached * ``moon_ra_dec_deg`` — Moon RA/Dec as Nx2 NumPy array (degrees), cached * ``moon_ra_dec_rad`` — Moon RA/Dec as Nx2 NumPy array (radians), cached * ``earth_ra_dec_deg`` — Earth RA/Dec as Nx2 NumPy array (degrees), cached * ``earth_ra_dec_rad`` — Earth RA/Dec as Nx2 NumPy array (radians), cached * ``sun_ra_deg``, ``sun_dec_deg`` — Sun RA and Dec as separate 1D arrays (degrees) * ``sun_ra_rad``, ``sun_dec_rad`` — Sun RA and Dec as separate 1D arrays (radians) * ``moon_ra_deg``, ``moon_dec_deg`` — Moon RA and Dec as separate 1D arrays (degrees) * ``moon_ra_rad``, ``moon_dec_rad`` — Moon RA and Dec as separate 1D arrays (radians) * ``earth_ra_deg``, ``earth_dec_deg`` — Earth RA and Dec as separate 1D arrays (degrees) * ``earth_ra_rad``, ``earth_dec_rad`` — Earth RA and Dec as separate 1D arrays (radians) **Methods:** * ``index(time)`` — Find the index of the closest timestamp to the given datetime - ``time`` — Python datetime object - Returns: ``int`` index that can be used to access ephemeris arrays - Example: ``idx = eph.index(datetime(2024, 1, 1, 12, 0, 0))`` then ``position = eph.gcrs_pv.position[idx]`` * ``get_body_pv(body)`` — Get position/velocity of a solar system body relative to observer - ``body`` — Body name (e.g., "Sun", "Moon", "Mars") or NAIF ID as string - Returns: ``PositionVelocityData`` with position/velocity in GCRS frame * ``get_body(body)`` — Get SkyCoord for a solar system body with observer location set - ``body`` — Body name or NAIF ID as string - Returns: ``astropy.coordinates.SkyCoord`` in GCRS frame **GroundEphemeris** Ground-based observatory ephemeris for a fixed point on Earth's surface. **Constructor:** ``GroundEphemeris(latitude, longitude, height, begin, end, step_size=60, *, polar_motion=False)`` * ``latitude`` — Geodetic latitude in degrees (-90 to 90) * ``longitude`` — Geodetic longitude in degrees (-180 to 180) * ``height`` — Altitude in meters above WGS84 ellipsoid **Attributes (read-only):** * ``latitude`` — Observatory latitude as an astropy Quantity array (degrees), one per timestamp * ``longitude`` — Observatory longitude as an astropy Quantity array (degrees), one per timestamp * ``height`` — Observatory height as an astropy Quantity array (meters), one per timestamp * ``height_m`` — Observatory height raw numpy array (meters), one per timestamp * ``gcrs_pv`` — Position/velocity in GCRS frame (PositionVelocityData) * ``itrs_pv`` — Position/velocity in ITRS frame (PositionVelocityData) * ``sun_pv`` — Sun position/velocity in GCRS frame (PositionVelocityData) * ``moon_pv`` — Moon position/velocity in GCRS frame (PositionVelocityData) * ``timestamp`` — List of Python datetime objects * ``itrs`` — ITRS coordinates as astropy SkyCoord * ``gcrs`` — GCRS coordinates as astropy SkyCoord * ``earth`` — Earth position as astropy SkyCoord * ``sun`` — Sun position as astropy SkyCoord * ``moon`` — Moon position as astropy SkyCoord * ``latitude`` — Geodetic latitude as an astropy Quantity array (degrees), one per timestamp * ``latitude_deg`` — Geodetic latitude as NumPy array (degrees), one per timestamp * ``latitude_rad`` — Geodetic latitude as NumPy array (radians), one per timestamp * ``longitude`` — Geodetic longitude as an astropy Quantity array (degrees), one per timestamp * ``longitude_deg`` — Geodetic longitude as NumPy array (degrees), one per timestamp * ``longitude_rad`` — Geodetic longitude as NumPy array (radians), one per timestamp * ``height`` — Height as an astropy Quantity array (meters), one per timestamp * ``height_m`` — Height as raw NumPy array (meters), one per timestamp * ``height_km`` — Height as raw NumPy array (kilometers), one per timestamp * ``obsgeoloc`` — Observer geocentric location (alias for GCRS position) * ``obsgeovel`` — Observer geocentric velocity (alias for GCRS velocity) * ``sun_radius`` — Sun angular radius as astropy Quantity (degrees) * ``sun_radius_deg`` — Sun angular radius as NumPy array (degrees) * ``sun_radius_rad`` — Sun angular radius as NumPy array (radians) * ``moon_radius`` — Moon angular radius as astropy Quantity (degrees) * ``moon_radius_deg`` — Moon angular radius as NumPy array (degrees) * ``moon_radius_rad`` — Moon angular radius as NumPy array (radians) * ``earth_radius`` — Earth angular radius as astropy Quantity (degrees) * ``earth_radius_deg`` — Earth angular radius as NumPy array (degrees) * ``earth_radius_rad`` — Earth angular radius as NumPy array (radians) * ``sun_ra_dec_deg`` — Sun RA/Dec as Nx2 NumPy array (degrees), cached * ``sun_ra_dec_rad`` — Sun RA/Dec as Nx2 NumPy array (radians), cached * ``moon_ra_dec_deg`` — Moon RA/Dec as Nx2 NumPy array (degrees), cached * ``moon_ra_dec_rad`` — Moon RA/Dec as Nx2 NumPy array (radians), cached * ``earth_ra_dec_deg`` — Earth RA/Dec as Nx2 NumPy array (degrees), cached * ``earth_ra_dec_rad`` — Earth RA/Dec as Nx2 NumPy array (radians), cached * ``sun_ra_deg``, ``sun_dec_deg`` — Sun RA and Dec as separate 1D arrays (degrees) * ``sun_ra_rad``, ``sun_dec_rad`` — Sun RA and Dec as separate 1D arrays (radians) * ``moon_ra_deg``, ``moon_dec_deg`` — Moon RA and Dec as separate 1D arrays (degrees) * ``moon_ra_rad``, ``moon_dec_rad`` — Moon RA and Dec as separate 1D arrays (radians) * ``earth_ra_deg``, ``earth_dec_deg`` — Earth RA and Dec as separate 1D arrays (degrees) * ``earth_ra_rad``, ``earth_dec_rad`` — Earth RA and Dec as separate 1D arrays (radians) **Methods:** * ``index(time)`` — Find the index of the closest timestamp to the given datetime - ``time`` — Python datetime object - Returns: ``int`` index that can be used to access ephemeris arrays - Example: ``idx = eph.index(datetime(2024, 1, 1, 12, 0, 0))`` then ``sun_position = eph.sun_pv.position[idx]`` * ``get_body_pv(body)`` — Get position/velocity of a solar system body relative to observer - ``body`` — Body name (e.g., "Sun", "Moon", "Mars") or NAIF ID as string - Returns: ``PositionVelocityData`` with position/velocity in GCRS frame - Requires: ``ensure_planetary_ephemeris()`` called first * ``get_body(body)`` — Get SkyCoord for a solar system body with observer location set - ``body`` — Body name or NAIF ID as string - Returns: ``astropy.coordinates.SkyCoord`` in GCRS frame **OEMEphemeris** Load and interpolate CCSDS Orbit Ephemeris Message (OEM) files for spacecraft ephemeris. The OEM file must use a GCRS-compatible reference frame such as J2000, EME2000, GCRF, or ICRF. Earth-fixed frames (e.g., ITRF) are not supported and will raise a ValueError. **Constructor:** ``OEMEphemeris(oem_file_path, begin, end, step_size=60, *, polar_motion=False)`` * ``oem_file_path`` — Path to CCSDS OEM file (.oem) * ``begin`` — Start time for ephemeris (Python datetime) * ``end`` — End time for ephemeris (Python datetime) * ``step_size`` — Time step in seconds for interpolated ephemeris (default: 60) * ``polar_motion`` — Enable polar motion corrections (default: False) **Raises:** * ``ValueError`` — If reference frame is missing or incompatible with GCRS **Attributes (read-only):** * ``oem_pv`` — Original OEM state vectors (PositionVelocityData) without interpolation * ``oem_timestamp`` — Original OEM timestamps (list of datetime) without interpolation * ``gcrs_pv`` — Interpolated position/velocity in GCRS frame (PositionVelocityData) * ``itrs_pv`` — Position/velocity in ITRS frame (PositionVelocityData) * ``sun_pv`` — Sun position/velocity in GCRS frame (PositionVelocityData) * ``moon_pv`` — Moon position/velocity in GCRS frame (PositionVelocityData) * ``timestamp`` — List of Python datetime objects for interpolated ephemeris * ``itrs`` — ITRS coordinates as astropy SkyCoord * ``gcrs`` — GCRS coordinates as astropy SkyCoord * ``earth`` — Earth position as astropy SkyCoord * ``sun`` — Sun position as astropy SkyCoord * ``moon`` — Moon position as astropy SkyCoord * ``latitude`` — Geodetic latitude as an astropy Quantity array (degrees), one per timestamp * ``latitude_deg`` — Geodetic latitude as NumPy array (degrees), one per timestamp * ``latitude_rad`` — Geodetic latitude as NumPy array (radians), one per timestamp * ``longitude`` — Geodetic longitude as an astropy Quantity array (degrees), one per timestamp * ``longitude_deg`` — Geodetic longitude as NumPy array (degrees), one per timestamp * ``longitude_rad`` — Geodetic longitude as NumPy array (radians), one per timestamp * ``height`` — Height as an astropy Quantity array (meters), one per timestamp * ``height_m`` — Height as raw NumPy array (meters), one per timestamp * ``height_km`` — Height as raw NumPy array (kilometers), one per timestamp * ``obsgeoloc`` — Observer geocentric location (alias for GCRS position) * ``obsgeovel`` — Observer geocentric velocity (alias for GCRS velocity) * ``sun_radius`` — Sun angular radius as astropy Quantity (degrees) * ``sun_radius_deg`` — Sun angular radius as NumPy array (degrees) * ``sun_radius_rad`` — Sun angular radius as NumPy array (radians) * ``moon_radius`` — Moon angular radius as astropy Quantity (degrees) * ``moon_radius_deg`` — Moon angular radius as NumPy array (degrees) * ``moon_radius_rad`` — Moon angular radius as NumPy array (radians) * ``earth_radius`` — Earth angular radius as astropy Quantity (degrees) * ``earth_radius_deg`` — Earth angular radius as NumPy array (degrees) * ``earth_radius_rad`` — Earth angular radius as NumPy array (radians) * ``sun_ra_dec_deg`` — Sun RA/Dec as Nx2 NumPy array (degrees), cached * ``sun_ra_dec_rad`` — Sun RA/Dec as Nx2 NumPy array (radians), cached * ``moon_ra_dec_deg`` — Moon RA/Dec as Nx2 NumPy array (degrees), cached * ``moon_ra_dec_rad`` — Moon RA/Dec as Nx2 NumPy array (radians), cached * ``earth_ra_dec_deg`` — Earth RA/Dec as Nx2 NumPy array (degrees), cached * ``earth_ra_dec_rad`` — Earth RA/Dec as Nx2 NumPy array (radians), cached * ``sun_ra_deg``, ``sun_dec_deg`` — Sun RA and Dec as separate 1D arrays (degrees) * ``sun_ra_rad``, ``sun_dec_rad`` — Sun RA and Dec as separate 1D arrays (radians) * ``moon_ra_deg``, ``moon_dec_deg`` — Moon RA and Dec as separate 1D arrays (degrees) * ``moon_ra_rad``, ``moon_dec_rad`` — Moon RA and Dec as separate 1D arrays (radians) * ``earth_ra_deg``, ``earth_dec_deg`` — Earth RA and Dec as separate 1D arrays (degrees) * ``earth_ra_rad``, ``earth_dec_rad`` — Earth RA and Dec as separate 1D arrays (radians) **Methods:** * ``index(time)`` — Find the index of the closest timestamp to the given datetime - ``time`` — Python datetime object - Returns: ``int`` index that can be used to access ephemeris arrays - Example: ``idx = eph.index(datetime(2032, 7, 1, 12, 0, 0))`` then ``position = eph.gcrs_pv.position[idx]`` * ``get_body_pv(body)`` — Get position/velocity of a solar system body relative to observer - ``body`` — Body name (e.g., "Sun", "Moon", "Mars") or NAIF ID as string - Returns: ``PositionVelocityData`` with position/velocity in GCRS frame - Requires: ``ensure_planetary_ephemeris()`` called first * ``get_body(body)`` — Get SkyCoord for a solar system body with observer location set - ``body`` — Body name or NAIF ID as string - Returns: ``astropy.coordinates.SkyCoord`` in GCRS frame **FileEphemeris** Load pre-computed state vectors from a simulator output file and resample to a uniform output grid via Hermite interpolation. Supports offset-based simulator output, simple CSV/TSV layouts, and any file where data rows contain seven whitespace-separated values: ``