You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"""Rotates the provided Cartesian state into the requested observer frame
173
+
174
+
**WARNING:** This function only performs the translation and no rotation _whatsoever_. Use the `transform_to` function instead to include rotations."""
"""Builds the rotation matrix that rotates from the topocentric frame (SEZ) into the body fixed frame of this state.
821
+
822
+
# Frame warnings
823
+
+ If the state is NOT in a body fixed frame (i.e. ITRF93), then this computation is INVALID.
824
+
+ (Usually) no time derivative can be computed: the orbit is expected to be a body fixed frame where the `at_epoch` function will fail. Exceptions for Moon body fixed frames.
825
+
826
+
# UNUSED Arguments
827
+
+ `from`: ID of this new frame. Only used to set the "from" frame of the DCM. -- No longer used since 0.5.3
828
+
829
+
# Source
830
+
From the GMAT MathSpec, page 30 section 2.6.9 and from `Calculate_RFT` in `TopocentricAxes.cpp`, this returns the
831
+
rotation matrix from the topocentric frame (SEZ) to body fixed frame.
832
+
In the GMAT MathSpec notation, R_{IF} is the DCM from body fixed to inertial. Similarly, R{FT} is from topocentric
833
+
to body fixed."""
834
+
835
+
defdcm_from_vnc_to_inertial(self) ->DCM:
836
+
"""Builds the rotation matrix that rotates from this state's inertial frame to this state's VNC frame (velocity, normal, cross)
837
+
838
+
# Frame warning
839
+
If the stattion is NOT in an inertial frame, then this computation is INVALID.
840
+
841
+
# Algorithm
842
+
1. Compute \\hat{v}, \\hat{h}, the unit vectors of the radius and orbital momentum.
843
+
2. Compute the cross product of these
844
+
3. Build the DCM with these unit vectors
845
+
4. Compute the difference between the DCMs of the pre and post states (+/- 1 ms), to build the DCM time derivative
846
+
4. Return the DCM structure with a 6x6 DCM with the time derivative of the VNC frame set.
847
+
848
+
# Note on the time derivative
849
+
If the pre or post states cannot be computed, then the time derivative of the DCM will _not_ be set.
850
+
Further note that most astrodynamics tools do *not* account for the time derivative in the RIC frame."""
851
+
719
852
defdeclination_deg(self) ->float:
720
853
"""Returns the declination of this orbit in degrees"""
721
854
@@ -1023,6 +1156,7 @@ class astro:
1023
1156
def__str__(self) ->str:
1024
1157
"""Return str(self)."""
1025
1158
1159
+
@typing.final
1026
1160
classconstants:
1027
1161
@typing.final
1028
1162
classCelestialObjects:
@@ -1065,7 +1199,11 @@ class astro:
1065
1199
MARS_BARYCENTER_J2000: Frame= ...
1066
1200
MERCURY_J2000: Frame= ...
1067
1201
MOON_J2000: Frame= ...
1202
+
MOON_ME_DE421_FRAME: Frame= ...
1203
+
MOON_ME_DE440_ME421_FRAME: Frame= ...
1068
1204
MOON_ME_FRAME: Frame= ...
1205
+
MOON_PA_DE421_FRAME: Frame= ...
1206
+
MOON_PA_DE440_FRAME: Frame= ...
1069
1207
MOON_PA_FRAME: Frame= ...
1070
1208
NEPTUNE_BARYCENTER_J2000: Frame= ...
1071
1209
PLUTO_BARYCENTER_J2000: Frame= ...
@@ -1090,14 +1228,19 @@ class astro:
1090
1228
ITRF93: int= ...
1091
1229
J2000: int= ...
1092
1230
MOON_ME: int= ...
1231
+
MOON_ME_DE421: int= ...
1232
+
MOON_ME_DE440_ME421: int= ...
1093
1233
MOON_PA: int= ...
1234
+
MOON_PA_DE421: int= ...
1235
+
MOON_PA_DE440: int= ...
1094
1236
1095
1237
@typing.final
1096
1238
classUsualConstants:
1097
1239
MEAN_EARTH_ANGULAR_VELOCITY_DEG_S: float= ...
1098
1240
MEAN_MOON_ANGULAR_VELOCITY_DEG_S: float= ...
1099
1241
SPEED_OF_LIGHT_KM_S: float= ...
1100
1242
1243
+
1101
1244
@typing.final
1102
1245
classtime:
1103
1246
@typing.final
@@ -2201,10 +2344,8 @@ KPL/TPC files must be converted into "PCA" (Planetary Constant ANISE) files befo
2201
2344
__all__: list= ...
2202
2345
__name__: str= ...
2203
2346
2204
-
2205
2347
@typing.final
2206
2348
classrotation:
2207
-
2208
2349
@typing.final
2209
2350
classDCM:
2210
2351
"""Defines a direction cosine matrix from one frame ID to another frame ID, optionally with its time derivative.
Copy file name to clipboardExpand all lines: anise/src/almanac/python.rs
+49-1Lines changed: 49 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,8 @@ use crate::{
16
16
astro::{Aberration,AzElRange,Occultation},
17
17
ephemerides::EphemerisError,
18
18
errors::AlmanacResult,
19
-
math::cartesian::CartesianState,
19
+
math::{cartesian::CartesianState, rotation::DCM},
20
+
orientations::OrientationError,
20
21
prelude::{Frame,Orbit},
21
22
NaifId,
22
23
};
@@ -59,6 +60,7 @@ impl Almanac {
59
60
/// :type spk: bool, optional
60
61
/// :type bpc: bool, optional
61
62
/// :type planetary: bool, optional
63
+
/// :type eulerparams: bool, optional
62
64
/// :type time_scale: TimeScale, optional
63
65
/// :type round_time: bool, optional
64
66
/// :rtype: None
@@ -410,4 +412,50 @@ impl Almanac {
410
412
) -> Result<CartesianState,EphemerisError>{
411
413
self.translate_to(state, observer_frame, ab_corr)
412
414
}
415
+
416
+
/// Returns the 6x6 DCM needed to rotation the `from_frame` to the `to_frame`.
417
+
///
418
+
/// # Warning
419
+
/// This function only performs the rotation and no translation whatsoever. Use the `transform_from_to` function instead to include rotations.
420
+
///
421
+
/// # Note
422
+
/// This function performs a recursion of no more than twice the MAX_TREE_DEPTH.
423
+
///
424
+
/// :type from_frame: Frame
425
+
/// :type to_frame: Frame
426
+
/// :type epoch: Epoch
427
+
/// :rtype: DCM
428
+
#[pyo3(name = "rotate", signature=(
429
+
from_frame,
430
+
to_frame,
431
+
epoch,
432
+
))]
433
+
pubfnpy_rotate(
434
+
&self,
435
+
from_frame:Frame,
436
+
to_frame:Frame,
437
+
epoch:Epoch,
438
+
) -> Result<DCM,OrientationError>{
439
+
self.rotate(from_frame, to_frame, epoch)
440
+
}
441
+
442
+
/// Rotates the provided Cartesian state into the requested observer frame
443
+
///
444
+
/// **WARNING:** This function only performs the translation and no rotation _whatsoever_. Use the `transform_to` function instead to include rotations.
0 commit comments