pub struct Cosm {
pub xb: Xb,
pub frame_root: FrameTree,
/* private fields */
}
Fields§
§xb: Xb
§frame_root: FrameTree
Implementations§
source§impl Cosm
impl Cosm
sourcepub fn from_xb(filename: &str) -> Result<Self, NyxError>
pub fn from_xb(filename: &str) -> Result<Self, NyxError>
Builds a Cosm from the *XB files. Path should not contain file extension. Panics if the files could not be loaded.
sourcepub fn try_de438() -> Result<Self, NyxError>
pub fn try_de438() -> Result<Self, NyxError>
Tries to load a subset of the DE438 XB from the embedded files, bounded between 01 Jan 2000 and 31 Dec 2050 TDB.
sourcepub fn de438() -> Arc<Self>
pub fn de438() -> Arc<Self>
Load a subset of the DE438 XB from the embedded files, bounded between 01 Jan 2000 and 31 Dec 2050 TAI.
sourcepub fn de438_raw() -> Self
pub fn de438_raw() -> Self
Load a subset of the DE438 XB from the embedded files, bounded between 01 Jan 2000 and 31 Dec 2050 TAI.
sourcepub fn de438_gmat() -> Arc<Self>
pub fn de438_gmat() -> Arc<Self>
Load a subset of the DE438 XB from the embedded files, bounded between 01 Jan 2000 and 31 Dec 2050 TAI.
sourcepub fn try_from_xb(xb: Xb) -> Result<Self, NyxError>
pub fn try_from_xb(xb: Xb) -> Result<Self, NyxError>
Attempts to build a Cosm from the XB files and the embedded IAU frames
sourcepub fn use_gmat_gm(&mut self)
pub fn use_gmat_gm(&mut self)
Switch the GM values to those from GMAT
sourcepub fn load_iau_frames(&mut self) -> Result<(), NyxError>
pub fn load_iau_frames(&mut self) -> Result<(), NyxError>
Load the IAU Frames as defined in Celest Mech Dyn Astr (2018) 130:22 (https://doi.org/10.1007/s10569-017-9805-5)
sourcepub fn frame_find_path_for_orientation(
&self,
name: &str
) -> Result<Vec<usize>, NyxError>
pub fn frame_find_path_for_orientation( &self, name: &str ) -> Result<Vec<usize>, NyxError>
Returns the machine path of the ephemeris whose orientation is requested
pub fn append_xb(&mut self)
sourcepub fn append_frames(&mut self, toml_content: &str) -> Result<(), NyxError>
pub fn append_frames(&mut self, toml_content: &str) -> Result<(), NyxError>
Append Cosm with the contents of this TOML (must not be the filename)
sourcepub fn try_frame(&self, name: &str) -> Result<Frame, NyxError>
pub fn try_frame(&self, name: &str) -> Result<Frame, NyxError>
Fetch the frame associated with this ephemeris name This is slow, so avoid using it.
sourcepub fn frame_from_ephem_path(&self, ephem_path: &[usize]) -> Frame
pub fn frame_from_ephem_path(&self, ephem_path: &[usize]) -> Frame
Provided an ephemeris path and an optional frame name, returns the Frame of that ephemeris. For example, if [3, 1] is provided (Moon in J2000 in the DE file), return Moon J2000 If no frame name is provided, then the storage frame is returned. Otherwise, the correct frame is returned.
sourcepub fn frame_from_frame_path(&self, frame_path: &[usize]) -> Frame
pub fn frame_from_frame_path(&self, frame_path: &[usize]) -> Frame
Provided a frame path returns the Frame.
pub fn frames_get_names(&self) -> Vec<String> ⓘ
sourcepub fn frames_get(&self) -> Vec<Frame> ⓘ
pub fn frames_get(&self) -> Vec<Frame> ⓘ
Returns all of the frames defined in this Cosm
sourcepub fn frame(&self, name: &str) -> Frame
pub fn frame(&self, name: &str) -> Frame
Returns the geoid from the loaded XB, if it is in there, else panics!
sourcepub fn frame_mut_gm(&mut self, name: &str, new_gm: f64)
pub fn frame_mut_gm(&mut self, name: &str, new_gm: f64)
Mutates the GM value for the provided geoid id. Panics if ID not found.
sourcepub fn raw_celestial_state(
&self,
path: &[usize],
epoch: Epoch
) -> Result<Orbit, NyxError>
pub fn raw_celestial_state( &self, path: &[usize], epoch: Epoch ) -> Result<Orbit, NyxError>
Returns the celestial state as computed from a de4xx.{FXB,XB} file in the original frame
sourcepub fn try_celestial_state(
&self,
target_ephem: &[usize],
datetime: Epoch,
frame: Frame,
correction: LightTimeCalc
) -> Result<Orbit, NyxError>
pub fn try_celestial_state( &self, target_ephem: &[usize], datetime: Epoch, frame: Frame, correction: LightTimeCalc ) -> Result<Orbit, NyxError>
Attempts to return the state of the celestial object at the provided time
The light time correction is based on SPICE’s implementation: https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/spkezr_c.html . Aberration computation is a conversion of the stelab function in SPICE, available here https://github.com/ChristopherRabotin/cspice/blob/26c72936fb7ff6f366803a1419b7cc3c61e0b6e5/src/cspice/stelab.c#L255
sourcepub fn celestial_state(
&self,
target_ephem: &[usize],
datetime: Epoch,
frame: Frame,
correction: LightTimeCalc
) -> Orbit
pub fn celestial_state( &self, target_ephem: &[usize], datetime: Epoch, frame: Frame, correction: LightTimeCalc ) -> Orbit
Returns the state of the celestial object (target ephem) as seen in the requested frame at the provided time
sourcepub fn try_position_dcm_from_to(
&self,
from: &Frame,
to: &Frame,
dt: Epoch
) -> Result<Matrix3<f64>, NyxError>
pub fn try_position_dcm_from_to( &self, from: &Frame, to: &Frame, dt: Epoch ) -> Result<Matrix3<f64>, NyxError>
Return the position DCM (3x3) to go from the from
frame to the to
frame
sourcepub fn try_dcm_from_to(
&self,
from: &Frame,
to: &Frame,
dt: Epoch
) -> Result<Matrix6<f64>, NyxError>
pub fn try_dcm_from_to( &self, from: &Frame, to: &Frame, dt: Epoch ) -> Result<Matrix6<f64>, NyxError>
Return the position and velocity DCM (6x6) to go from the from
frame to the to
frame
sourcepub fn try_dcm_from_to_in_parts(
&self,
from: &Frame,
to: &Frame,
dt: Epoch
) -> Result<(Matrix3<f64>, Matrix3<f64>), NyxError>
pub fn try_dcm_from_to_in_parts( &self, from: &Frame, to: &Frame, dt: Epoch ) -> Result<(Matrix3<f64>, Matrix3<f64>), NyxError>
Return the position and velocity DCM (two 3x3 matrices) to go from the from
frame to the to
frame
sourcepub fn try_frame_translation(
&self,
state: &Orbit,
new_frame: Frame
) -> Result<Orbit, NyxError>
pub fn try_frame_translation( &self, state: &Orbit, new_frame: Frame ) -> Result<Orbit, NyxError>
Attempts to only perform a translation without rotation between two frames.
You really shouldn’t be using this unless you know exactly what you’re doing.
Typically, you want to use try_frame_chg
.
WARNING: This will update the Frame of the Orbit to the requested one EVEN IF it doesn’t rotate it.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Cosm
impl Send for Cosm
impl Sync for Cosm
impl Unpin for Cosm
impl !UnwindSafe for Cosm
Blanket Implementations§
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> Printing<T> for Twhere
T: Display,
impl<T> Printing<T> for Twhere T: Display,
§fn to_str(self) -> String
fn to_str(self) -> String
printing.rs
. §fn to_plainstr(self) -> String
fn to_plainstr(self) -> String
printing.rs
.§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.