Skip to main content

Inpop

Python NumPy License Status

Compute high-precision planetary positions, lunar librations, and relativistic time transformations using the INPOP ephemerides.

Install via pip:

pip3 install Inpop

Project description

Inpop is a pure Python library for computing high-precision planetary positions, lunar librations, and relativistic time transformations using the "Institut de mécanique céleste et de calcul des éphémérides"] (IMCCE) INPOP ephemerides.

INPOP ephemerides are distributed as binary .dat files containing Chebyshev coefficients, which parameterize the barycentric motion of solar system bodies over fixed time intervals. Inpop reads these coefficients, evaluates the Chebyshev series, and computes positions, velocities, libration angles, and time transformations.

Inpop is primarily designed for astrometry, celestial mechanics, and navigation software, providing direct access to the underlying ephemeris data rather than high-level astronomical reductions.


Downloading INPOP files

INPOP .dat files can be downloaded from the IMCCE FTP server:
https://ftp.imcce.fr/pub/ephem/planets/

If the file is not found locally, the Inpop library will attempt to download it automatically to a writable directory.


Requirements

  • Python 3.10+
  • NumPy
  • Numba (optional, for just-in-time acceleration when loading data into memory)

Provides

The package provides a single class, Inpop. It can compute:

  • Planetary positions (AU)
  • Velocities (AU/day)
  • Lunar libration angles (rad)
  • Time transformations (TT–TDB, TCG–TCB)
  • First-order derivatives of all above quantities

Quickstart

from inpop import Inpop

# Open a small INPOP file (auto-download if not present)
inpop = Inpop("inpop21a_TDB_m100_p100_tt.dat")

# Inspect available time range and timescale
print(inpop.jd_beg, inpop.jd_end)  # Julian dates
print(inpop.timescale)             # TDB or TCB

# Compute state vector: moon relative to earth at J2000.0
pv = inpop.PV(2451545.0, 'moon', 'earth')
print(pv)

How Inpop works

INPOP files contain Chebyshev coefficients for each body over fixed intervals. Inpop evaluates these polynomials to compute positions, velocities, and time corrections.

INPOP .dat file
       │
       │  Chebyshev coefficients
       ▼
+-----------------------+
|    Inpop library      |
|                       |
|  • file reader        |
|  • Chebyshev eval     |
|  • time transforms    |
+-----------------------+
       │
       ▼
Computed quantities

  • planetary position (AU)
  • velocity (AU/day)
  • lunar libration angles (rad)
  • TT–TDB or TCG–TCB time offsets

Workflow:

Julian date
     │
     ▼
select Chebyshev segment
     │
     ▼
evaluate polynomial series
     │
     ▼
state vector (position, velocity)

Accuracy and verification

  • Double-precision arithmetic
  • Numerical errors: ~2e-14 AU for positions, sub-microsecond for time over 200 years
  • For sub-millisecond timing, pass Julian dates as [day, fraction] for maximum precision

Core methods

PV(jd, target, center, rate=True, ts=None)

Compute the state vector of a solar system body (target) relative to another (center) at time jd.

  • Returns [P, V] if rate=True, or position vector P if rate=False.
  • target and center can be integers 0–12 or strings:
 0 mercury
 1 venus
 2 earth
 3 mars
 4 jupiter
 5 saturn
 6 uranus
 7 neptune
 8 pluto
 9 moon
10 sun
11 ssb
12 emb
  • Optional ts keyword: "TDB" or "TCB" to force timescale conversion.

LBR(jd, rate=True, ts=None)

Compute the physical libration angles of the moon. Returns angles in radians and optionally angular velocities.

TTmTDB(tt_jd, rate=False)

Time difference between TT and TDB in seconds, evaluated at tt_jd.

TCGmTCB(tcg_jd, rate=False)

Time difference between TCB and TCG in seconds.

close(), __del__()

Close the INPOP file safely.


Constants

Access key constants directly:

print(inpop.AU, inpop.EMRAT)
print(inpop.constants)  # dictionary of up to 400 ephemeris constants

Units are automatically converted to AU, AU/day, seconds, and radians.


Citation

Please cite INPOP if using it in scientific work:

Fienga, A., et al. (2019). INPOP planetary ephemerides. Celestial Mechanics and Dynamical Astronomy, 130(12). https://doi.org/10.1007/s10569-019-09921-2

INPOP ephemerides are produced by the "Institut de mécanique céleste et de calcul des éphémérides" (IMCCE).


Author

Marcel Hesselberth


License

Metadata

Release files for Inpop 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for Inpop 1.0.2
File Size Uploaded Provenance
inpop-1.0.2.tar.gz 24.6 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for Inpop 1.0.2
File Interpreter ABI Platform
inpop-1.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 50.1 kB

Release files / inpop-1.0.2.tar.gz

Download URL inpop-1.0.2.tar.gz
Size 24.6 kB
Tags Source
SHA-256 checksum
How to use checksums
ab44caba1c7d93f19440489ff25acf41ec2e84e6254687e3d74e6b04aa4a0afe
BLAKE2b-256 checksum
How to use checksums
bd520a99bb8a4d4c2b83caff6f931551bbde57bedce3da524daf08a5cb56952d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / inpop-1.0.2-py3-none-any.whl

Download URL inpop-1.0.2-py3-none-any.whl
Size 25.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f1fad372a869a19a4e153ec073f3d9c851b0667537e09f83d3ab5f2c36aca2d1
BLAKE2b-256 checksum
How to use checksums
6b53d409cabbab5221d3cf1119c198b2eb230684aa158eff32384c63e2718e5c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Security for Inpop 1.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page