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:
- Chinese version: 中文版PDF.
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.bspvariant, note thetfor 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:
-
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. -
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
- Import necessary Python packages
import numpy as np import R2S2
- Import the local planetary ephemeris file containing the time ephemeris (note: modify the actual file path accordingly).
R2S2.init_E("/path/to/de440t.bsp")
- 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
- Input the spatial coordinates in the selenocentric system compatible with TCL, in kilometers.
Y = np.array([3000, 1813, 454])
- Call the
TCL2TCBfunction in R2S2 to compute the transformation from (TCL, Y) to (TCB, x), whereDelta_tandDelta_xrepresent 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3f8f56d9fe01bb87ff425ebfab1f396a12046f828ee346765df83dc1fdf727b0
|
|
| MD5 |
03cf8f2be7734b4fac527987970cb4b7
|
|
| BLAKE2b-256 |
171dad3be7135ebd9c65189247726349fe5dd758b8163ba7a686cbffb2085916
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
15cee1f1f6c752e59c280bcebe0020029961671c528a1e0ace5f2df9965bf9f1
|
|
| MD5 |
e34d77b73a31c1ffc061974dce768ef0
|
|
| BLAKE2b-256 |
ef82b0883496385309b95a4fd7797fc85192ec4c537baba19a1b4b7a2853e647
|