Skip to main content

Tools for calculating the coordinate transformation between the Earth-Moon space-time reference systems.

Project description

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]

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

r2s2-0.1.0.tar.gz (10.0 MB view details)

Uploaded Source

Built Distribution

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

r2s2-0.1.0-py3-none-any.whl (10.1 MB view details)

Uploaded Python 3

File details

Details for the file r2s2-0.1.0.tar.gz.

File metadata

  • Download URL: r2s2-0.1.0.tar.gz
  • Upload date:
  • Size: 10.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for r2s2-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3f8f56d9fe01bb87ff425ebfab1f396a12046f828ee346765df83dc1fdf727b0
MD5 03cf8f2be7734b4fac527987970cb4b7
BLAKE2b-256 171dad3be7135ebd9c65189247726349fe5dd758b8163ba7a686cbffb2085916

See more details on using hashes here.

File details

Details for the file r2s2-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: r2s2-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for r2s2-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 15cee1f1f6c752e59c280bcebe0020029961671c528a1e0ace5f2df9965bf9f1
MD5 e34d77b73a31c1ffc061974dce768ef0
BLAKE2b-256 ef82b0883496385309b95a4fd7797fc85192ec4c537baba19a1b4b7a2853e647

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