pub struct Almanac {
pub spk_data: [Option<GenericDAF<SPKSummaryRecord, Bytes>>; 32],
pub bpc_data: [Option<GenericDAF<BPCSummaryRecord, Bytes>>; 8],
pub planetary_data: DataSet<PlanetaryData, anise::::structure::PlanetaryDataSet::{constant#0}>,
pub spacecraft_data: DataSet<SpacecraftData, anise::::structure::SpacecraftDataSet::{constant#0}>,
pub euler_param_data: DataSet<EulerParameter, anise::::structure::EulerParameterDataSet::{constant#0}>,
}
Expand description
An Almanac contains all of the loaded SPICE and ANISE data.
§Limitations
The stack space required depends on the maximum number of each type that can be loaded.
Fields§
§spk_data: [Option<GenericDAF<SPKSummaryRecord, Bytes>>; 32]
NAIF SPK is kept unchanged
bpc_data: [Option<GenericDAF<BPCSummaryRecord, Bytes>>; 8]
NAIF BPC is kept unchanged
planetary_data: DataSet<PlanetaryData, anise::::structure::PlanetaryDataSet::{constant#0}>
Dataset of planetary data
spacecraft_data: DataSet<SpacecraftData, anise::::structure::SpacecraftDataSet::{constant#0}>
Dataset of spacecraft data
euler_param_data: DataSet<EulerParameter, anise::::structure::EulerParameterDataSet::{constant#0}>
Dataset of euler parameters
Implementations§
§impl Almanac
impl Almanac
pub fn azimuth_elevation_range_sez(
&self,
rx: CartesianState,
tx: CartesianState
) -> Result<AzElRange, AlmanacError>
pub fn azimuth_elevation_range_sez( &self, rx: CartesianState, tx: CartesianState ) -> Result<AzElRange, AlmanacError>
Computes the azimuth (in degrees), elevation (in degrees), and range (in kilometers) of the
receiver state (rx
) seen from the transmitter state (tx
), once converted into the SEZ frame of the transmitter.
§Algorithm
- Compute the SEZ (South East Zenith) frame of the transmitter.
- Rotate the receiver position vector into the transmitter SEZ frame.
- Rotate the transmitter position vector into that same SEZ frame.
- Compute the range as the norm of the difference between these two position vectors.
- Compute the elevation, and ensure it is between +/- 180 degrees.
- Compute the azimuth with a quadrant check, and ensure it is between 0 and 360 degrees.
§impl Almanac
impl Almanac
pub fn from_bpc( bpc: GenericDAF<BPCSummaryRecord, Bytes> ) -> Result<Almanac, OrientationError>
pub fn with_bpc(
&self,
bpc: GenericDAF<BPCSummaryRecord, Bytes>
) -> Result<Almanac, OrientationError>
pub fn with_bpc( &self, bpc: GenericDAF<BPCSummaryRecord, Bytes> ) -> Result<Almanac, OrientationError>
Loads a Binary Planetary Constants kernel.
pub fn num_loaded_bpc(&self) -> usize
pub fn bpc_summary_from_name_at_epoch(
&self,
name: &str,
epoch: Epoch
) -> Result<(&BPCSummaryRecord, usize, usize), OrientationError>
pub fn bpc_summary_from_name_at_epoch( &self, name: &str, epoch: Epoch ) -> Result<(&BPCSummaryRecord, usize, usize), OrientationError>
Returns the summary given the name of the summary record if that summary has data defined at the requested epoch and the BPC where this name was found to be valid at that epoch.
pub fn bpc_summary_at_epoch(
&self,
id: i32,
epoch: Epoch
) -> Result<(&BPCSummaryRecord, usize, usize), OrientationError>
pub fn bpc_summary_at_epoch( &self, id: i32, epoch: Epoch ) -> Result<(&BPCSummaryRecord, usize, usize), OrientationError>
Returns the summary given the name of the summary record if that summary has data defined at the requested epoch
pub fn bpc_summary_from_name(
&self,
name: &str
) -> Result<(&BPCSummaryRecord, usize, usize), OrientationError>
pub fn bpc_summary_from_name( &self, name: &str ) -> Result<(&BPCSummaryRecord, usize, usize), OrientationError>
Returns the summary given the name of the summary record.
pub fn bpc_summary(
&self,
id: i32
) -> Result<(&BPCSummaryRecord, usize, usize), OrientationError>
pub fn bpc_summary( &self, id: i32 ) -> Result<(&BPCSummaryRecord, usize, usize), OrientationError>
Returns the summary given the name of the summary record if that summary has data defined at the requested epoch
§impl Almanac
impl Almanac
pub fn bpc_summaries(
&self,
id: i32
) -> Result<Vec<BPCSummaryRecord>, OrientationError>
pub fn bpc_summaries( &self, id: i32 ) -> Result<Vec<BPCSummaryRecord>, OrientationError>
Returns a vector of the summaries whose ID matches the desired id
, in the order in which they will be used, i.e. in reverse loading order.
pub fn bpc_domain(&self, id: i32) -> Result<(Epoch, Epoch), OrientationError>
pub fn bpc_domain(&self, id: i32) -> Result<(Epoch, Epoch), OrientationError>
Returns the applicable domain of the request id, i.e. start and end epoch that the provided id has loaded data.
§impl Almanac
impl Almanac
pub fn frame_from_uid<U>(&self, uid: U) -> Result<Frame, PlanetaryDataError>
pub fn frame_from_uid<U>(&self, uid: U) -> Result<Frame, PlanetaryDataError>
Given the frame UID (or something that can be transformed into it), attempt to retrieve the full frame information, if that frame is loaded
pub fn with_planetary_data(
&self,
planetary_data: DataSet<PlanetaryData, anise::::structure::PlanetaryDataSet::{constant#0}>
) -> Almanac
pub fn with_planetary_data( &self, planetary_data: DataSet<PlanetaryData, anise::::structure::PlanetaryDataSet::{constant#0}> ) -> Almanac
Loads the provided planetary data into a clone of this original Almanac.
§impl Almanac
impl Almanac
pub fn sun_angle_deg(
&self,
target_id: i32,
observer_id: i32,
epoch: Epoch
) -> Result<f64, EphemerisError>
pub fn sun_angle_deg( &self, target_id: i32, observer_id: i32, epoch: Epoch ) -> Result<f64, EphemerisError>
Returns the angle (between 0 and 180 degrees) between the observer and the Sun, and the observer and the target body ID. This computes the Sun Probe Earth angle (SPE) if the probe is in a loaded SPK, its ID is the “observer_id”, and the target is set to its central body.
§Geometry
If the SPE is greater than 90 degrees, then the celestial object below the probe is in sunlight.
§Sunrise at nadir
Sun
| \
| \
| \
Obs. -- Target
§Sun high at nadir
Sun
\
\ __ θ > 90
\ \
Obs. ---------- Target
§Sunset at nadir
Sun
/
/ __ θ < 90
/ /
Obs. -- Target
§Algorithm
- Compute the position of the Sun as seen from the observer
- Compute the position of the target as seen from the observer
- Return the arccosine of the dot product of the norms of these vectors.
§impl Almanac
impl Almanac
pub fn from_spk( spk: GenericDAF<SPKSummaryRecord, Bytes> ) -> Result<Almanac, EphemerisError>
pub fn with_spk(
&self,
spk: GenericDAF<SPKSummaryRecord, Bytes>
) -> Result<Almanac, EphemerisError>
pub fn with_spk( &self, spk: GenericDAF<SPKSummaryRecord, Bytes> ) -> Result<Almanac, EphemerisError>
Loads a new SPK file into a new context. This new context is needed to satisfy the unloading of files. In fact, to unload a file, simply let the newly loaded context drop out of scope and Rust will clean it up.
§impl Almanac
impl Almanac
pub fn num_loaded_spk(&self) -> usize
pub fn spk_summary_from_name_at_epoch(
&self,
name: &str,
epoch: Epoch
) -> Result<(&SPKSummaryRecord, usize, usize), EphemerisError>
pub fn spk_summary_from_name_at_epoch( &self, name: &str, epoch: Epoch ) -> Result<(&SPKSummaryRecord, usize, usize), EphemerisError>
Returns the summary given the name of the summary record if that summary has data defined at the requested epoch and the SPK where this name was found to be valid at that epoch.
pub fn spk_summary_at_epoch(
&self,
id: i32,
epoch: Epoch
) -> Result<(&SPKSummaryRecord, usize, usize), EphemerisError>
pub fn spk_summary_at_epoch( &self, id: i32, epoch: Epoch ) -> Result<(&SPKSummaryRecord, usize, usize), EphemerisError>
Returns the summary given the name of the summary record if that summary has data defined at the requested epoch
pub fn spk_summary_from_name(
&self,
name: &str
) -> Result<(&SPKSummaryRecord, usize, usize), EphemerisError>
pub fn spk_summary_from_name( &self, name: &str ) -> Result<(&SPKSummaryRecord, usize, usize), EphemerisError>
Returns the most recently loaded summary by its name, if any with that ID are available
pub fn spk_summary(
&self,
id: i32
) -> Result<(&SPKSummaryRecord, usize, usize), EphemerisError>
pub fn spk_summary( &self, id: i32 ) -> Result<(&SPKSummaryRecord, usize, usize), EphemerisError>
Returns the most recently loaded summary by its ID, if any with that ID are available
§impl Almanac
impl Almanac
pub fn spk_summaries(
&self,
id: i32
) -> Result<Vec<SPKSummaryRecord>, EphemerisError>
pub fn spk_summaries( &self, id: i32 ) -> Result<Vec<SPKSummaryRecord>, EphemerisError>
Returns a vector of the summaries whose ID matches the desired id
, in the order in which they will be used, i.e. in reverse loading order.
§Warning
This function performs a memory allocation.
pub fn spk_domain(&self, id: i32) -> Result<(Epoch, Epoch), EphemerisError>
pub fn spk_domain(&self, id: i32) -> Result<(Epoch, Epoch), EphemerisError>
Returns the applicable domain of the request id, i.e. start and end epoch that the provided id has loaded data.
§impl Almanac
impl Almanac
pub fn transform(
&self,
target_frame: Frame,
observer_frame: Frame,
epoch: Epoch,
ab_corr: Option<Aberration>
) -> Result<CartesianState, AlmanacError>
pub fn transform( &self, target_frame: Frame, observer_frame: Frame, epoch: Epoch, ab_corr: Option<Aberration> ) -> Result<CartesianState, AlmanacError>
Returns the Cartesian state needed to transform the from_frame
to the to_frame
.
§SPICE Compatibility
This function is the SPICE equivalent of spkezr: spkezr(TARGET_ID, EPOCH_TDB_S, ORIENTATION_ID, ABERRATION, OBSERVER_ID)
In ANISE, the TARGET_ID and ORIENTATION are provided in the first argument (TARGET_FRAME), as that frame includes BOTH
the target ID and the orientation of that target. The EPOCH_TDB_S is the epoch in the TDB time system, which is computed
in ANISE using Hifitime. THe ABERRATION is computed by providing the optional Aberration flag. Finally, the OBSERVER
argument is replaced by OBSERVER_FRAME: if the OBSERVER_FRAME argument has the same orientation as the TARGET_FRAME, then this call
will return exactly the same data as the spkerz SPICE call.
§Note
The units will be those of the underlying ephemeris data (typically km and km/s)
pub fn transform_to(
&self,
state: CartesianState,
observer_frame: Frame,
ab_corr: Option<Aberration>
) -> Result<CartesianState, AlmanacError>
pub fn transform_to( &self, state: CartesianState, observer_frame: Frame, ab_corr: Option<Aberration> ) -> Result<CartesianState, AlmanacError>
Translates 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.
pub fn state_of(
&self,
object: i32,
observer: Frame,
epoch: Epoch,
ab_corr: Option<Aberration>
) -> Result<CartesianState, AlmanacError>
pub fn state_of( &self, object: i32, observer: Frame, epoch: Epoch, ab_corr: Option<Aberration> ) -> Result<CartesianState, AlmanacError>
Returns the Cartesian state of the object as seen from the provided observer frame (essentially spkezr
).
§Note
The units will be those of the underlying ephemeris data (typically km and km/s)
§impl Almanac
impl Almanac
pub fn transform_state_to(
&self,
position: Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>,
velocity: Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>,
from_frame: Frame,
to_frame: Frame,
epoch: Epoch,
ab_corr: Option<Aberration>,
distance_unit: LengthUnit,
time_unit: Unit
) -> Result<CartesianState, AlmanacError>
pub fn transform_state_to( &self, position: Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>, velocity: Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>, from_frame: Frame, to_frame: Frame, epoch: Epoch, ab_corr: Option<Aberration>, distance_unit: LengthUnit, time_unit: Unit ) -> Result<CartesianState, AlmanacError>
Translates 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.
§impl Almanac
impl Almanac
pub fn load_from_metafile(
&self,
metafile: MetaFile
) -> Result<Almanac, AlmanacError>
pub fn load_from_metafile( &self, metafile: MetaFile ) -> Result<Almanac, AlmanacError>
Load from the provided MetaFile, downloading it if necessary.
§impl Almanac
impl Almanac
pub fn new(path: &str) -> Result<Almanac, AlmanacError>
pub fn new(path: &str) -> Result<Almanac, AlmanacError>
Initializes a new Almanac from the provided file path, guessing at the file type
pub fn with_spacecraft_data(
&self,
spacecraft_data: DataSet<SpacecraftData, anise::::structure::SpacecraftDataSet::{constant#0}>
) -> Almanac
pub fn with_spacecraft_data( &self, spacecraft_data: DataSet<SpacecraftData, anise::::structure::SpacecraftDataSet::{constant#0}> ) -> Almanac
Loads the provided spacecraft data into a clone of this original Almanac.
pub fn with_euler_parameters(
&self,
ep_dataset: DataSet<EulerParameter, anise::::structure::EulerParameterDataSet::{constant#0}>
) -> Almanac
pub fn with_euler_parameters( &self, ep_dataset: DataSet<EulerParameter, anise::::structure::EulerParameterDataSet::{constant#0}> ) -> Almanac
Loads the provided Euler parameter data into a clone of this original Almanac.
pub fn load_from_bytes(&self, bytes: Bytes) -> Result<Almanac, AlmanacError>
§impl Almanac
impl Almanac
pub fn load(&self, path: &str) -> Result<Almanac, AlmanacError>
pub fn load(&self, path: &str) -> Result<Almanac, AlmanacError>
Generic function that tries to load the provided path guessing to the file type.
pub fn describe(
&self,
spk: Option<bool>,
bpc: Option<bool>,
planetary: Option<bool>,
time_scale: Option<TimeScale>,
round_time: Option<bool>
)
pub fn describe( &self, spk: Option<bool>, bpc: Option<bool>, planetary: Option<bool>, time_scale: Option<TimeScale>, round_time: Option<bool> )
Pretty prints the description of this Almanac, showing everything by default. Default time scale is TDB. If any parameter is set to true, then nothing other than that will be printed.
§impl Almanac
impl Almanac
pub fn try_find_ephemeris_root(&self) -> Result<i32, EphemerisError>
pub fn try_find_ephemeris_root(&self) -> Result<i32, EphemerisError>
Returns the root of all of the loaded ephemerides, typically this should be the Solar System Barycenter.
§Algorithm
- For each loaded SPK, iterated in reverse order (to mimic SPICE behavior)
- For each summary record in each SPK, follow the ephemeris branch all the way up until the end of this SPK or until the SSB.
pub fn ephemeris_path_to_root(
&self,
source: Frame,
epoch: Epoch
) -> Result<(usize, [Option<i32>; 8]), EphemerisError>
pub fn ephemeris_path_to_root( &self, source: Frame, epoch: Epoch ) -> Result<(usize, [Option<i32>; 8]), EphemerisError>
Try to construct the path from the source frame all the way to the root ephemeris of this context.
pub fn common_ephemeris_path(
&self,
from_frame: Frame,
to_frame: Frame,
epoch: Epoch
) -> Result<(usize, [Option<i32>; 8], i32), EphemerisError>
pub fn common_ephemeris_path( &self, from_frame: Frame, to_frame: Frame, epoch: Epoch ) -> Result<(usize, [Option<i32>; 8], i32), EphemerisError>
Returns the ephemeris path between two frames and the common node. This may return a DisjointRoots
error if the frames do not share a common root, which is considered a file integrity error.
§Example
If the “from” frame is Earth Barycenter whose path to the ANISE root is the following:
Solar System barycenter
╰─> Earth Moon Barycenter
╰─> Earth
And the “to” frame is Moon, whose path is:
Solar System barycenter
╰─> Earth Moon Barycenter
╰─> Moon
╰─> LRO
Then this function will return the path an array of hashes of up to [MAX_TREE_DEPTH] items. In this example, the array with the hashes of the “Earth Moon Barycenter” and “Moon”.
§Note
A proper ANISE file should only have a single root and if two paths are empty, then they should be the same frame. If a DisjointRoots error is reported here, it means that the ANISE file is invalid.
§Time complexity
This can likely be simplified as this as a time complexity of O(n×m) where n, m are the lengths of the paths from the ephemeris up to the root. This can probably be optimized to avoid rewinding the entire frame path up to the root frame
§impl Almanac
impl Almanac
pub fn translate_to_parent(
&self,
source: Frame,
epoch: Epoch
) -> Result<CartesianState, EphemerisError>
pub fn translate_to_parent( &self, source: Frame, epoch: Epoch ) -> Result<CartesianState, EphemerisError>
Performs the GEOMETRIC translation to the parent. Use translate_from_to for aberration.
§impl Almanac
impl Almanac
pub fn translate(
&self,
target_frame: Frame,
observer_frame: Frame,
epoch: Epoch,
ab_corr: Option<Aberration>
) -> Result<CartesianState, EphemerisError>
pub fn translate( &self, target_frame: Frame, observer_frame: Frame, epoch: Epoch, ab_corr: Option<Aberration> ) -> Result<CartesianState, EphemerisError>
Returns the Cartesian state of the target frame as seen from the observer frame at the provided epoch, and optionally given the aberration correction.
§SPICE Compatibility
This function is the SPICE equivalent of spkezr: spkezr(TARGET_ID, EPOCH_TDB_S, ORIENTATION_ID, ABERRATION, OBSERVER_ID)
In ANISE, the TARGET_ID and ORIENTATION are provided in the first argument (TARGET_FRAME), as that frame includes BOTH
the target ID and the orientation of that target. The EPOCH_TDB_S is the epoch in the TDB time system, which is computed
in ANISE using Hifitime. THe ABERRATION is computed by providing the optional Aberration flag. Finally, the OBSERVER
argument is replaced by OBSERVER_FRAME: if the OBSERVER_FRAME argument has the same orientation as the TARGET_FRAME, then this call
will return exactly the same data as the spkerz SPICE call.
§Warning
This function only performs the translation and no rotation whatsoever. Use the transform
function instead to include rotations.
§Note
This function performs a recursion of no more than twice the [MAX_TREE_DEPTH].
pub fn translate_geometric(
&self,
target_frame: Frame,
observer_frame: Frame,
epoch: Epoch
) -> Result<CartesianState, EphemerisError>
pub fn translate_geometric( &self, target_frame: Frame, observer_frame: Frame, epoch: Epoch ) -> Result<CartesianState, EphemerisError>
Returns the geometric position vector, velocity vector, and acceleration vector needed to translate the from_frame
to the to_frame
, where the distance is in km, the velocity in km/s, and the acceleration in km/s^2.
pub fn translate_to(
&self,
state: CartesianState,
observer_frame: Frame,
ab_corr: Option<Aberration>
) -> Result<CartesianState, EphemerisError>
pub fn translate_to( &self, state: CartesianState, observer_frame: Frame, ab_corr: Option<Aberration> ) -> Result<CartesianState, EphemerisError>
Translates the provided Cartesian state into the requested observer frame
WARNING: This function only performs the translation and no rotation whatsoever. Use the transform_to
function instead to include rotations.
§impl Almanac
impl Almanac
pub fn translate_state_to(
&self,
position: Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>,
velocity: Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>,
from_frame: Frame,
observer_frame: Frame,
epoch: Epoch,
ab_corr: Option<Aberration>,
distance_unit: LengthUnit,
time_unit: Unit
) -> Result<CartesianState, EphemerisError>
pub fn translate_state_to( &self, position: Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>, velocity: Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>, from_frame: Frame, observer_frame: Frame, epoch: Epoch, ab_corr: Option<Aberration>, distance_unit: LengthUnit, time_unit: Unit ) -> Result<CartesianState, EphemerisError>
Translates 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.
§impl Almanac
impl Almanac
pub fn try_find_orientation_root(&self) -> Result<i32, OrientationError>
pub fn try_find_orientation_root(&self) -> Result<i32, OrientationError>
Returns the root of all of the loaded orientations (BPC or planetary), typically this should be J2000.
§Algorithm
- For each loaded BPC, iterated in reverse order (to mimic SPICE behavior)
- For each summary record in each BPC, follow the orientation branch all the way up until the end of this BPC or until the J2000.
pub fn orientation_path_to_root(
&self,
source: Frame,
epoch: Epoch
) -> Result<(usize, [Option<i32>; 8]), OrientationError>
pub fn orientation_path_to_root( &self, source: Frame, epoch: Epoch ) -> Result<(usize, [Option<i32>; 8]), OrientationError>
Try to construct the path from the source frame all the way to the root orientation of this context.
pub fn common_orientation_path(
&self,
from_frame: Frame,
to_frame: Frame,
epoch: Epoch
) -> Result<(usize, [Option<i32>; 8], i32), OrientationError>
pub fn common_orientation_path( &self, from_frame: Frame, to_frame: Frame, epoch: Epoch ) -> Result<(usize, [Option<i32>; 8], i32), OrientationError>
Returns the orientation path between two frames and the common node. This may return a DisjointRoots
error if the frames do not share a common root, which is considered a file integrity error.
§impl Almanac
impl Almanac
pub fn rotation_to_parent(
&self,
source: Frame,
epoch: Epoch
) -> Result<DCM, OrientationError>
pub fn rotation_to_parent( &self, source: Frame, epoch: Epoch ) -> Result<DCM, OrientationError>
Returns the direct cosine matrix (DCM) to rotate from the source
to its parent in the orientation hierarchy at the provided epoch,
§Example
If the ephemeris stores position interpolation coefficients in kilometer but this function is called with millimeters as a distance unit, the output vectors will be in mm, mm/s, mm/s^2 respectively.
§Errors
- As of now, some interpolation types are not supported, and if that were to happen, this would return an error.
WARNING: This function only performs the rotation and no translation whatsoever. Use the transform_to_parent_from
function instead to include rotations.
§impl Almanac
impl Almanac
pub fn rotate_from_to(
&self,
from_frame: Frame,
to_frame: Frame,
epoch: Epoch
) -> Result<DCM, OrientationError>
pub fn rotate_from_to( &self, from_frame: Frame, to_frame: Frame, epoch: Epoch ) -> Result<DCM, OrientationError>
pub fn rotate_state_to(
&self,
position: Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>,
velocity: Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>,
from_frame: Frame,
to_frame: Frame,
epoch: Epoch,
distance_unit: LengthUnit,
time_unit: Unit
) -> Result<CartesianState, OrientationError>
pub fn rotate_state_to( &self, position: Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>, velocity: Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>, from_frame: Frame, to_frame: Frame, epoch: Epoch, distance_unit: LengthUnit, time_unit: Unit ) -> Result<CartesianState, OrientationError>
Translates 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.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Almanac
impl RefUnwindSafe for Almanac
impl Send for Almanac
impl Sync for Almanac
impl Unpin for Almanac
impl UnwindSafe for Almanac
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.