Skip to content

Commit

Permalink
Add MOON ME/PA of DE421 and DE440
Browse files Browse the repository at this point in the history
Expose almanac's rotation function to Python
  • Loading branch information
ChristopherRabotin committed Dec 31, 2024
1 parent 3fe4183 commit f2f7eb8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
12 changes: 12 additions & 0 deletions anise-py/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,14 @@ impl Frames {
#[classattr]
const MOON_ME_DE421_FRAME: Frame = MOON_ME_DE421_FRAME;
#[classattr]
const MOON_ME_DE440_ME421_FRAME: Frame = MOON_ME_DE440_ME421_FRAME;
#[classattr]
const MOON_PA_FRAME: Frame = MOON_PA_FRAME;
#[classattr]
const MOON_PA_DE421_FRAME: Frame = MOON_PA_DE421_FRAME;
#[classattr]
const MOON_PA_DE440_FRAME: Frame = MOON_PA_DE440_FRAME;
#[classattr]
const IAU_MOON_FRAME: Frame = IAU_MOON_FRAME;
#[classattr]
const IAU_MARS_FRAME: Frame = IAU_MARS_FRAME;
Expand Down Expand Up @@ -106,8 +112,14 @@ impl Orientations {
#[classattr]
const MOON_ME_DE421: i32 = MOON_ME_DE421;
#[classattr]
const MOON_ME_DE440_ME421: i32 = MOON_ME_DE440_ME421;
#[classattr]
const MOON_PA: i32 = MOON_PA;
#[classattr]
const MOON_PA_DE421: i32 = MOON_PA_DE421;
#[classattr]
const MOON_PA_DE440: i32 = MOON_PA_DE440;
#[classattr]
const ITRF93: i32 = ITRF93;
#[classattr]
const IAU_MARS: i32 = IAU_MARS;
Expand Down
6 changes: 6 additions & 0 deletions anise/src/orientations/rotations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ use crate::math::units::*;
use crate::math::Vector3;
use crate::prelude::Frame;

#[cfg(feature = "python")]
use pyo3::prelude::*;

#[cfg_attr(feature = "python", pymethods)]
impl Almanac {
/// Returns the 6x6 DCM needed to rotation the `from_frame` to the `to_frame`.
///
Expand Down Expand Up @@ -124,7 +128,9 @@ impl Almanac {

(dcm * state).context(OrientationPhysicsSnafu {})
}
}

impl Almanac {
/// Rotates a state with its origin (`to_frame`) and given its units (distance_unit, time_unit), returns that state with respect to the requested frame
///
/// **WARNING:** This function only performs the translation and no rotation _whatsoever_. Use the `transform_state_to` function instead to include rotations.
Expand Down

0 comments on commit f2f7eb8

Please sign in to comment.