Skip to main content

Ephemeris for Solar System Objects with JPL/Horizons

Project description

EPHESSOS

Ephemeris for Solar System Objects with JPL/Horizons

PyPI version License: BSD

EPHESSOS is a Python library for querying ephemeris data of solar system objects from NASA's JPL Horizons system. It provides an easy interface to retrieve positional and observational data for asteroids, comets, and planets.

Features

  • Query JPL Horizons using orbital elements or object designations
  • Parse MPC NEA (Near-Earth Asteroid) data files
  • Retrieve comprehensive ephemeris data including RA, Dec, distance, and more
  • Support for custom time ranges and step sizes
  • Integration with Astropy for astronomical calculations

Installation

Install EPHESSOS using pip:

pip install ephessos

Or from source:

git clone https://github.com/Borlaff/EPHESSOS.git
cd EPHESSOS
pip install .

Quick Start

Here's a simple example showing how to query the ephemeris of asteroid (433) Eros:

import ephessos as ep
from astropy.time import Time

# Define time range
mjd_start = Time('2024-01-01T00:00:00', format='isot', scale='utc').mjd
mjd_end = Time('2024-01-15T00:00:00', format='isot', scale='utc').mjd

# Query Horizons for Eros (designation: 00433)
eros_data = ep.core.sso_query_to_horizons(
    designation="00433",
    mjd_start=mjd_start,
    mjd_end=mjd_end,
    step_size="1d",
    verbose=True
)

print(eros_data.head())

This will return a pandas DataFrame containing ephemeris data including:

  • Right Ascension (RA) and Declination (Dec) in degrees
  • Distance from observer
  • Magnitude and other observational quantities
  • Modified Julian Date (MJD)

Advanced Usage

Reading MPC Data Files

EPHESSOS can parse MPC-formatted NEA files:

# Read MPC NEA data
nea_table = ep.core.read_mpc_nea_file("path/to/nea.txt")

# Query ephemeris for the first object
first_object = nea_table.iloc[0]
data = ep.core.sso_query_to_horizons(
    designation=first_object["Designation"],
    epoch=first_object["Epoch"],
    eccentricity=first_object["Eccentricity"],
    node=first_object["Node"],
    arg_perihelion=first_object["Arg_Perihelion"],
    inclination=first_object["Inclination"],
    mean_anomaly=first_object["Mean_Anomaly"],
    semimajor_axis=first_object["Semimajor_Axis"],
    mean_motion=first_object["Mean_Motion"],
    mjd_start=mjd_start,
    mjd_end=mjd_end,
    step_size="1d"
)

Command Line Interface

EPHESSOS also provides a command-line interface through the ephessos executable, which allows you to query ephemeris data directly from the terminal without writing Python code.

Basic Usage

After installation, you can use the ephessos command to generate ephemeris data. You must provide the orbital elements and time range:

 ephessos --designation=433 --epoch=2461000.5 --eccentricity=0.222836 --node=304.27008 --arg_perihelion=178.92978 --inclination=10.82847 --mean_anomaly=310.55432 --semimajor_axis=1.458121 --mean_motion=0.55977529 --mjdstart=58849.0 --mjdend=61042.0 --step_size=1d --output="eros_ephem.csv"

Required Parameters

  • --designation: Object designation (e.g., "00433" for Eros)
  • --epoch: Julian Date of the osculating elements
  • --eccentricity: Orbital eccentricity
  • --node: Longitude of the ascending node (degrees)
  • --arg_perihelion: Argument of perihelion (degrees)
  • --inclination: Orbital inclination (degrees)
  • --mean_anomaly: Mean anomaly (degrees)
  • --semimajor_axis: Semi-major axis (AU)
  • --mean_motion: Mean motion (degrees/day)
  • --mjdstart: Start time as Modified Julian Date
  • --mjdend: End time as Modified Julian Date

Optional Parameters

  • --step_size: Time step for ephemeris (default: "1d" for 1 day)
    • Examples: "1d", "12h", "6h", "1h", "30m"
  • --output: Output CSV filename (default: "horizons_ephemeris.csv")
  • --verbose: Enable verbose output

The output will be a CSV file containing columns for:

  • Date/time information
  • Right Ascension and Declination (ICRF)
  • Apparent magnitude
  • Distance from observer and Sun
  • And other ephemeris quantities

Converting Dates to MJD

To convert calendar dates to Modified Julian Dates for use with --mjdstart and --mjdend, you can use online converters or Python:

from astropy.time import Time
t = Time('2024-01-01T00:00:00', format='isot', scale='utc')
print(f"MJD: {t.mjd}")

Contributing

Contributions are welcome! Please see our contributing guidelines for details.

License

EPHESSOS is licensed under the BSD 3-Clause License. See LICENSE for details.

Citation

If you use EPHESSOS in your research, please cite:

Borlaff, A. S., & Dotson, J. (2026). EPHESSOS: Ephemeris for Solar System Objects with JPL/Horizons.

Contact

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ephessos-1.0.2.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ephessos-1.0.2-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file ephessos-1.0.2.tar.gz.

File metadata

  • Download URL: ephessos-1.0.2.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for ephessos-1.0.2.tar.gz
Algorithm Hash digest
SHA256 49cb280959a96dd25b93b512682f44041ded56a27c6263afa8e2ec4e8e2c3927
MD5 2ad3216bce2f7b5da55f33b197570aac
BLAKE2b-256 2d74e3f813733b5dd8b18ce8e6cdc880e186c068d03720e5d2389517d7d9590f

See more details on using hashes here.

File details

Details for the file ephessos-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: ephessos-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for ephessos-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ad0908a6d78bc4d1d60ddb1a6c347858b75f675854b02925960aba538359c1c5
MD5 98c252b4586a4e98ee3c64ab9075261a
BLAKE2b-256 64dc5a7486ef1c1b7ddaba5b9f0d3470f5f040b6c5fbf911b52bafbe005d3196

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page