- The
MoonRotationclass calculates the direction cosine matrix (DCM) from the J2000 inertial frame to the Moon-Centered Moon-Fixed (MCMF) frame. - Users can select an idle model, a simple model based on the instantaneous Earth-Moon orbital geometry, or the
IAU_MOONframe calculated by CSPICE. - The calculated DCM is managed by
CelestialInformationand is used by features such as the lunar gravity-field disturbance calculation.
This feature was introduced in PR #511.
moon_rotation.cpp,moon_rotation.hpp: Definition and declaration of theMoonRotationclassmoon_rotation_utilities.cpp,moon_rotation_utilities.hpp: Mean Earth and Principal Axis frame calculationscelestial_information.cpp,celestial_information.hpp: Initialization and periodic update ofMoonRotationlunar_gravity_field.cpp: Use of the MCMF transformation in the lunar gravity-field calculationsample_simulation_base.ini: Example initialization file
- Set
inertial_frame = J2000in the[CELESTIAL_INFORMATION]section. - Include both
EARTHandMOONinselected_body_namewhen using theSIMPLEmodel. - Set the
rotation_modeentry with the same index as theMOONentry inselected_body_name. - Call
CelestialInformation::UpdateAllObjectsInformationto update the Moon rotation together with the other celestial information. - Obtain the transformation with
GetMoonRotation().GetDcmJ2000ToMcmf(). - When transforming a position vector, first ensure that its origin is the Moon center. The returned value is a DCM and does not translate the vector origin.
The sample configuration selects the Moon as body index 2:
[CELESTIAL_INFORMATION]
inertial_frame = J2000
number_of_selected_body = 3
selected_body_name(0) = EARTH
selected_body_name(1) = SUN
selected_body_name(2) = MOON
rotation_mode(0) = FULL
rotation_mode(1) = DISABLE
rotation_mode(2) = SIMPLE| Setting | Description |
|---|---|
IDLE |
Sets the J2000-to-MCMF DCM to the identity matrix. |
SIMPLE |
Constructs a Mean Earth frame from the Earth-Moon relative orbit and applies a constant DE430 Mean Earth-to-Principal Axis correction. |
IAU_MOON |
Uses CSPICE to calculate the state transformation from J2000 to IAU_MOON and extracts its 3-by-3 rotation matrix. |
If the setting is not IDLE, SIMPLE, or IAU_MOON, the mode falls back to IDLE. Therefore, DISABLE also results in the identity matrix when used as a Moon rotation setting.
The IAU_MOON mode requires CSPICE kernels that define time conversion and the IAU_MOON orientation. The sample CSPICE kernel settings satisfy these requirements.
- In
SIMPLEmode, obtain the Moon position and velocity relative to the Earth and calculate the Principal Axis Moon-fixed frame. - In
IAU_MOONmode, obtain the current ephemeris time fromSimulationTimeand request theJ2000-to-IAU_MOONstate transformation from CSPICE. - In
IDLEmode, set the DCM to the identity matrix.
The output is
Let $\boldsymbol{r}{E\rightarrow M}^{i}$ and $\boldsymbol{v}{E\rightarrow M}^{i}$ be the Moon position and velocity relative to the Earth in the J2000 inertial frame. The Mean Earth frame basis vectors expressed in J2000 are calculated as
The +X axis points from the Moon toward the Earth, the +Z axis is the Earth-Moon orbital normal, and the +Y axis completes the right-handed frame. The basis vectors form the rows of the J2000-to-Mean-Earth DCM:
The fixed rotation from the Mean Earth frame to the DE430 Principal Axis frame is calculated with
The final simple-model transformation is
The implementation calls the CSPICE sxform_c function with from = J2000, to = IAU_MOON, and the current ephemeris time. CSPICE returns a 6-by-6 state transformation, from which the upper-left 3-by-3 rotation matrix is stored as the J2000-to-MCMF DCM.
Only the orientation DCM is retained. The angular-velocity terms contained in the full state transformation are not exposed by MoonRotation.
SIMPLEmode approximates the lunar orientation from the instantaneous Earth-Moon direction and orbital plane plus a constant frame correction. Detailed physical librations and higher-accuracy time-dependent orientation effects are not explicitly modeled.IAU_MOONaccuracy and valid time coverage depend on the loaded CSPICE kernels.- The implementation and getter explicitly define the inertial input frame as J2000. A different
inertial_framesetting is not converted internally byMoonRotation. - The DCM changes only vector orientation; users must separately express position vectors relative to the Moon center.
LunarGravityField converts the spacecraft position from the Moon-centered inertial frame to MCMF with the Moon rotation DCM, evaluates the spherical-harmonic lunar gravity acceleration in MCMF, and converts the result back to the inertial frame. A non-idle Moon rotation model is therefore required for a physically meaningful non-spherical lunar gravity-field calculation.
PR #511 compared the DCM calculated by SIMPLE mode with the DCM produced by CSPICE in IAU_MOON mode at 2020/01/01 12:00 and 2023/10/01 12:00.
The comparison confirms that the simple orbital-geometry model produces a lunar-fixed orientation similar to the CSPICE IAU_MOON result at both evaluated epochs. The results are not identical because the two modes use different orientation models and the simple model omits detailed lunar libration behavior.
- S2E-core PR #511: Add moon rotation
- J. G. Williams, D. H. Boggs, and W. M. Folkner, “DE430 Lunar Orbit, Physical Librations, and Surface Coordinates”, 2013.
- A Standardized Lunar Coordinate System for the Lunar Reconnaissance Orbiter and Lunar Datasets.
