From 400958386a9dc4dd2cad04f0d677d5ed586bcc23 Mon Sep 17 00:00:00 2001 From: Dirk Stolle Date: Sun, 12 Feb 2023 01:14:15 +0100 Subject: [PATCH 1/2] Fix some typos --- README.md | 2 +- src/cosmic/cosm.rs | 10 +++++----- src/cosmic/mod.rs | 2 +- src/cosmic/xb.rs | 8 ++++---- src/dynamics/guidance/ruggiero.rs | 6 +++--- src/io/formatter.rs | 4 ++-- src/nav/state.rs | 2 +- src/propagators/error_ctrl.rs | 6 +++--- tests/propagation/stopcond.rs | 8 ++++---- 9 files changed, 24 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 67968aa6..2eae4f7f 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ Outstanding mission design features available [here](https://gitlab.com/chrisrab ## Celestial computations - [x] Orbital state manipulation - [x] Planetary and Solar eclipse and visibility computation -- [x] Light-time corrections and abberations +- [x] Light-time corrections and aberrations - [x] Frame rotations # Who am I? diff --git a/src/cosmic/cosm.rs b/src/cosmic/cosm.rs index 58e7e31d..316d39d2 100644 --- a/src/cosmic/cosm.rs +++ b/src/cosmic/cosm.rs @@ -58,8 +58,8 @@ pub enum LightTimeCalc { None, /// Accounts for light-time correction. This is corresponds to CN in SPICE. LightTime, - /// Accounts for light-time and stellar abberation where the solar system barycenter is the inertial frame. Corresponds to CN+S in SPICE. - Abberation, + /// Accounts for light-time and stellar aberration where the solar system barycenter is the inertial frame. Corresponds to CN+S in SPICE. + Aberration, } #[derive(Debug)] @@ -755,7 +755,7 @@ impl Cosm { let state = Orbit::cartesian(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, datetime, target_frame); Ok(-self.try_frame_chg(&state, frame)?) } - LightTimeCalc::LightTime | LightTimeCalc::Abberation => { + LightTimeCalc::LightTime | LightTimeCalc::Aberration => { // Get the geometric states as seen from SSB let ssb2k = self.frame_root.frame; @@ -797,7 +797,7 @@ impl Cosm { state.vy = tgt.vy * (1.0 - dltdt) - obs.vy; state.vz = tgt.vz * (1.0 - dltdt) - obs.vz; - if correction == LightTimeCalc::Abberation { + if correction == LightTimeCalc::Aberration { // Get a unit vector that points in the direction of the object let r_hat = state.r_hat(); // Get the velocity vector (of the observer) scaled with respect to the speed of light @@ -1396,7 +1396,7 @@ mod tests { Bodies::EarthBarycenter.ephem_path(), jde, mars2k, - LightTimeCalc::Abberation, + LightTimeCalc::Aberration, ); assert!(dbg!(out_state.x - -2.577_231_712_700_484_4e8).abs() < 1e-3); diff --git a/src/cosmic/mod.rs b/src/cosmic/mod.rs index 86c24f02..ce60b179 100644 --- a/src/cosmic/mod.rs +++ b/src/cosmic/mod.rs @@ -111,7 +111,7 @@ where } /// Allows setting the value of the given parameter. - /// NOTE: Most paramaters where the `value` is available CANNOT be also set for that parameter (it's a much harder problem!) + /// NOTE: Most parameters where the `value` is available CANNOT be also set for that parameter (it's a much harder problem!) fn set_value(&mut self, _param: &StateParameter, _val: f64) -> Result<(), NyxError> { Err(NyxError::StateParameterUnavailable) } diff --git a/src/cosmic/xb.rs b/src/cosmic/xb.rs index 7ea48d91..5e8bcf36 100644 --- a/src/cosmic/xb.rs +++ b/src/cosmic/xb.rs @@ -272,7 +272,7 @@ pub struct AttitudeRegistry { /// states. These time entries are seconds past the start_epoch provided in the /// higher struct. Perform a binary search in this index to retrieve time key /// for the desired time. In other words, search for the closest time to the - /// desired time, and retrive the Attitude for this time. Check the repr enum + /// desired time, and retrieve the Attitude for this time. Check the repr enum /// to understand the attitude representation. If it isn't set, check the /// comments or discuss with the publisher of the file. /// @@ -383,7 +383,7 @@ pub struct AttitudeInterp { /// interpolated states. These time entries are seconds past the /// start_mod_julian dates (which is in days). Perform a binary search in this /// index to retrieve time key for the desired time. In other words, search for - /// the closest time to the desired time, retrive the InterpState for this + /// the closest time to the desired time, retrieve the InterpState for this /// time, build the interpolation functions, and finally apply these at the /// desired time. /// @@ -488,7 +488,7 @@ pub enum AttitudeRepr { } #[derive(Clone, PartialEq, prost::Message)] pub struct Ephemeris { - /// Nmae of this ephemeris + /// Name of this ephemeris #[prost(string, tag = "1")] pub name: prost::alloc::string::String, /// Name of the orientation frame @@ -683,7 +683,7 @@ pub struct VarWindowStates { /// interpolated states. These time entries are seconds past the start_epoch /// (defined in the parent Ephemeris object). Perform a binary search in this /// index to retrieve time key for the desired time. In other words, search for - /// the closest time to the desired time, retrive the InterpState for this + /// the closest time to the desired time, retrieve the InterpState for this /// time, build the interpolation functions, and finally apply these at the /// desired time. NOTE: Limitations of protobufs require this index to be an /// integer. NOTE: For better platform support, these reference times are diff --git a/src/dynamics/guidance/ruggiero.rs b/src/dynamics/guidance/ruggiero.rs index 9732ba48..fe562d45 100644 --- a/src/dynamics/guidance/ruggiero.rs +++ b/src/dynamics/guidance/ruggiero.rs @@ -38,7 +38,7 @@ pub struct Ruggiero { } /// The Ruggiero is a locally optimal guidance law of a state for specific osculating elements. -/// NOTE: The efficency parameters for AoP is NOT implemented: the paper's formulation is broken. +/// NOTE: The efficiency parameters for AoP is NOT implemented: the paper's formulation is broken. /// WARNING: Objectives must be in degrees! impl Ruggiero { /// Creates a new Ruggiero locally optimal control as an Arc @@ -98,7 +98,7 @@ impl Ruggiero { })) } - /// Returns the efficency η ∈ [0; 1] of correcting a specific orbital element at the provided osculating orbit + /// Returns the efficiency η ∈ [0; 1] of correcting a specific orbital element at the provided osculating orbit pub fn efficency(parameter: &StateParameter, osc_orbit: &Orbit) -> Result { let e = osc_orbit.ecc(); match parameter { @@ -137,7 +137,7 @@ impl Ruggiero { } } - /// Computes the weight at which to correct this orbital element, will be zero if the current efficency is below the threshold + /// Computes the weight at which to correct this orbital element, will be zero if the current efficiency is below the threshold fn weighting(&self, obj: &Objective, osc_orbit: &Orbit, η_threshold: f64) -> f64 { let init = self.init_state.value(&obj.parameter).unwrap(); let osc = osc_orbit.value(&obj.parameter).unwrap(); diff --git a/src/io/formatter.rs b/src/io/formatter.rs index 7a862cd3..9a9b01a7 100644 --- a/src/io/formatter.rs +++ b/src/io/formatter.rs @@ -66,7 +66,7 @@ impl OutputSerde { #[allow(non_camel_case_types)] #[derive(Clone, Debug, PartialEq)] pub struct StateHeader { - /// Stores either the state paramater or the epoch + /// Stores either the state parameter or the epoch pub param: StateParameter, pub frame_name: Option, pub epoch_fmt: Option, @@ -671,7 +671,7 @@ impl NavSolutionFormatter { "covar_velocity" => hdrs.push(NavSolutionHeader::Covar_vel), "estimate" | "nominal" => { let param = StateParameter::from_str(splt[1].to_lowercase().as_str()) - .expect("Unknown paramater"); + .expect("Unknown parameter"); let state_hdr = StateHeader { param, diff --git a/src/nav/state.rs b/src/nav/state.rs index db503b08..aa155471 100644 --- a/src/nav/state.rs +++ b/src/nav/state.rs @@ -114,7 +114,7 @@ impl NavState for OrbitNavState {} // { // /// Estimated physical state // state: X, -// /// Estimated paramaters +// /// Estimated parameters // parameters: P, // } diff --git a/src/propagators/error_ctrl.rs b/src/propagators/error_ctrl.rs index 6c2f4c06..aa2a240e 100644 --- a/src/propagators/error_ctrl.rs +++ b/src/propagators/error_ctrl.rs @@ -44,7 +44,7 @@ where /// A largest error control which effectively computes the largest error at each component /// -/// This is a standard error computation algorithm, but it's argubly bad if the state's components have different units. +/// This is a standard error computation algorithm, but it's arguably bad if the state's components have different units. /// It calculates the largest local estimate of the error from the integration (`error_est`) /// given the difference in the candidate state and the previous state (`state_delta`). /// This error estimator is from the physical model estimator of GMAT @@ -78,7 +78,7 @@ impl ErrorCtrl for LargestError { /// A largest step error control which effectively computes the L1 norm of the provided Vector of size 3 /// -/// Note that this error controller should be preferrably be used only with slices of a state with the same units. +/// Note that this error controller should be preferably be used only with slices of a state with the same units. /// For example, one should probably use this for position independently of using it for the velocity. /// (Source)[https://github.com/ChristopherRabotin/GMAT/blob/37201a6290e7f7b941bc98ee973a527a5857104b/src/base/forcemodel/ODEModel.cpp#L3033] #[derive(Clone, Copy)] @@ -140,7 +140,7 @@ impl ErrorCtrl for LargestState { /// An RSS step error control which effectively computes the L2 norm of the provided Vector of size 3 /// -/// Note that this error controller should be preferrably be used only with slices of a state with the same units. +/// Note that this error controller should be preferably be used only with slices of a state with the same units. /// For example, one should probably use this for position independently of using it for the velocity. /// (Source)[https://github.com/ChristopherRabotin/GMAT/blob/37201a6290e7f7b941bc98ee973a527a5857104b/src/base/forcemodel/ODEModel.cpp#L3045] #[derive(Clone, Copy)] diff --git a/tests/propagation/stopcond.rs b/tests/propagation/stopcond.rs index 08c0a46f..7f7b3051 100644 --- a/tests/propagation/stopcond.rs +++ b/tests/propagation/stopcond.rs @@ -58,7 +58,7 @@ fn stop_cond_3rd_apo() { assert!( (180.0 - third_apo.ta()).abs() < 1e-3, - "converged, yet convergence critera not met" + "converged, yet convergence criteria not met" ); } @@ -111,7 +111,7 @@ fn stop_cond_3rd_peri() { assert!( third_peri.ta().abs() < 1e-1 || (360.0 - third_peri.ta().abs() < 1e-1), - "converged, yet convergence critera not met" + "converged, yet convergence criteria not met" ); } @@ -229,7 +229,7 @@ fn line_of_nodes() { assert!( lon_state.geodetic_longitude().abs() < lon_event.value_precision, - "converged, yet convergence critera not met" + "converged, yet convergence criteria not met" ); } @@ -258,6 +258,6 @@ fn latitude() { assert!( (2.0 - lon_state.geodetic_latitude()).abs() < lat_event.value_precision, - "converged, yet convergence critera not met" + "converged, yet convergence criteria not met" ); } From 96a6ad32a5d0dc19579112d430d2411efecbbf96 Mon Sep 17 00:00:00 2001 From: Dirk Stolle Date: Mon, 13 Feb 2023 23:49:08 +0100 Subject: [PATCH 2/2] Revert breaking changes of previous commit --- src/cosmic/cosm.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cosmic/cosm.rs b/src/cosmic/cosm.rs index 316d39d2..4ba961e2 100644 --- a/src/cosmic/cosm.rs +++ b/src/cosmic/cosm.rs @@ -59,7 +59,7 @@ pub enum LightTimeCalc { /// Accounts for light-time correction. This is corresponds to CN in SPICE. LightTime, /// Accounts for light-time and stellar aberration where the solar system barycenter is the inertial frame. Corresponds to CN+S in SPICE. - Aberration, + Abberation, } #[derive(Debug)] @@ -755,7 +755,7 @@ impl Cosm { let state = Orbit::cartesian(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, datetime, target_frame); Ok(-self.try_frame_chg(&state, frame)?) } - LightTimeCalc::LightTime | LightTimeCalc::Aberration => { + LightTimeCalc::LightTime | LightTimeCalc::Abberation => { // Get the geometric states as seen from SSB let ssb2k = self.frame_root.frame; @@ -797,7 +797,7 @@ impl Cosm { state.vy = tgt.vy * (1.0 - dltdt) - obs.vy; state.vz = tgt.vz * (1.0 - dltdt) - obs.vz; - if correction == LightTimeCalc::Aberration { + if correction == LightTimeCalc::Abberation { // Get a unit vector that points in the direction of the object let r_hat = state.r_hat(); // Get the velocity vector (of the observer) scaled with respect to the speed of light @@ -1396,7 +1396,7 @@ mod tests { Bodies::EarthBarycenter.ephem_path(), jde, mars2k, - LightTimeCalc::Aberration, + LightTimeCalc::Abberation, ); assert!(dbg!(out_state.x - -2.577_231_712_700_484_4e8).abs() < 1e-3);