Skip to main content

Relativistic Reference System Service (R2S2)

The R2S2 Python package provides a systematic solution for relativistic spacetime coordinate transformations in the cislunar space.

Features

The core functions encapsulated in R2S2 package enable bidirectional and strictly IAU-resolution-compliant transformation calculations between any two of the six commonly used spacetime coordinates across three reference systems in the cislunar space:

  • Barycentric Celestial Reference System (BCRS)
  • Geocentric Celestial Reference System (GCRS)
  • Lunar Celestial Reference System (LCRS)

Documentation

For detailed information, please refer to the package documentation:

Dependencies

R2S2 depends on the following Python library:

Data files for the following ephemerides are required:

  • Planetary and lunar ephemeris with a built-in earth time ephemeris.

    We recommend DE440 (de440t.bsp variant, note the t for built-in time ephemeris), which is available at JPL website with this link.

  • Lunar time ephemeris.

    The lunar time ephemeris, LTE440, is developed by our team and included in R2S2 package. No manually downloads are required.

Installation

The detailed installation steps are as follows:

  1. Install calcephpy

    For 64-bit windows systems with Python 3.10 to 3.14, we provide the wheel packages of calcephpy v4.0.5 for easy installation

    pip install calcephpy-4.0.5-cp314-cp314-win_amd64.whl
    

    For other Python versions or OSes, the package can be installed from PyPi with pip install calcephpy. But it needs locally building as described in the official install instructions. We also provide a step-by-step guide here.

  2. Install R2S2

    The R2S2 package can be installed with pip

    pip install r2s2
    

    This will install its dependencies, and install the R2S2 package.

Quick Start

Take transformation from lunar coordinates (TCL, Y) to barycentric (TCB, x) as an example

  1. Import necessary Python packages
    import numpy as np
    import R2S2
    
  2. Import the local planetary ephemeris file containing the time ephemeris (note: modify the actual file path accordingly).
    R2S2.init_E("/path/to/de440t.bsp")
    
  3. Input the integer and fractional parts of the Julian Day in Lunar Coordinate Time (TCL), in days. The following corresponds to approximately 2026-01-04 11:23:39 TCL.
    jd1 = 2460094
    jd2 = 0.9747569458346726
    
  4. Input the spatial coordinates in the selenocentric system compatible with TCL, in kilometers.
    Y = np.array([3000, 1813, 454])
    
  5. Call the TCL2TCB function in R2S2 to compute the transformation from (TCL, Y) to (TCB, x), where Delta_t and Delta_x represent the iterative accuracy of time and space transformations, with units of seconds and kilometers respectively.
    TCB1, TCB2, x = R2S2.TCL2TCB(jd1, jd2, Y, Delta_t = 10**(-9), Delta_x = 10**(-6))
    

Output should be

TCB1 =  2460094
TCB2 =  0.9750082547331026
x =  [-5.72776989e+07 -1.29690213e+08 -5.61695394e+07]

Metadata

Release files for r2s2 0.1.0

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

Source distribution (sdist)

Source distribution for r2s2 0.1.0
File Size Uploaded
r2s2-0.1.0.tar.gz 10.0 MB Details

Built distribution (wheel)

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

Total release size: 20.1 MB

Release files / r2s2-0.1.0.tar.gz

Download URL r2s2-0.1.0.tar.gz
Size 10.0 MB
Tags Source
SHA-256 checksum
How to use checksums
3f8f56d9fe01bb87ff425ebfab1f396a12046f828ee346765df83dc1fdf727b0
BLAKE2b-256 checksum
How to use checksums
171dad3be7135ebd9c65189247726349fe5dd758b8163ba7a686cbffb2085916
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release files / r2s2-0.1.0-py3-none-any.whl

Download URL r2s2-0.1.0-py3-none-any.whl
Size 10.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
15cee1f1f6c752e59c280bcebe0020029961671c528a1e0ace5f2df9965bf9f1
BLAKE2b-256 checksum
How to use checksums
ef82b0883496385309b95a4fd7797fc85192ec4c537baba19a1b4b7a2853e647
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

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