diff --git a/src/od/simulator/arc.rs b/src/od/simulator/arc.rs index 9b823ee8..08254077 100644 --- a/src/od/simulator/arc.rs +++ b/src/od/simulator/arc.rs @@ -25,7 +25,7 @@ pub use crate::dynamics::{Dynamics, NyxError}; use crate::io::ConfigError; use crate::md::trajectory::Interpolatable; use crate::od::msr::{RangeDoppler, TrackingArc}; -use crate::od::prelude::EpochRanges; +use crate::od::prelude::Strand; use crate::od::simulator::Cadence; use crate::od::{GroundStation, Measurement}; pub use crate::{cosmic::Cosm, State, TimeTagged}; @@ -322,7 +322,7 @@ impl TrackingArcSim { continue; } - let mut strand_range = EpochRanges { + let mut strand_range = Strand { start: strand_start, end: strand_end, }; @@ -464,7 +464,7 @@ impl TrackingArcSim { traj.find_bracketed(start_at + 1.0_f64.seconds(), end_at, &device) { let strand_end = visibility_event.state.epoch(); - let mut strand_range = EpochRanges { + let mut strand_range = Strand { start: start_at, end: strand_end, }; diff --git a/src/od/simulator/mod.rs b/src/od/simulator/mod.rs index 60d9940c..82c8b93b 100644 --- a/src/od/simulator/mod.rs +++ b/src/od/simulator/mod.rs @@ -25,4 +25,4 @@ pub use scheduler::{Cadence, Handoff, Scheduler}; mod trackdata; pub use trackdata::TrackingDeviceSim; mod trkconfig; -pub use trkconfig::{EpochRanges, TrkConfig}; +pub use trkconfig::{Strand, TrkConfig}; diff --git a/src/od/simulator/trkconfig.rs b/src/od/simulator/trkconfig.rs index e91743d0..d71ee653 100644 --- a/src/od/simulator/trkconfig.rs +++ b/src/od/simulator/trkconfig.rs @@ -52,7 +52,7 @@ pub struct TrkConfig { pub sampling: Duration, /// List of tracking strands during which the given tracker will be tracking #[builder(default, setter(strip_option))] - pub strands: Option>, + pub strands: Option>, } impl ConfigRepr for TrkConfig {} @@ -133,18 +133,18 @@ impl Default for TrkConfig { } } -/// Stores an epoch range for tracking. +/// Stores a tracking strand with a start and end epoch #[derive(Copy, Clone, Debug, Serialize, Deserialize, PartialEq)] #[cfg_attr(feature = "python", pyclass)] #[cfg_attr(feature = "python", pyo3(module = "nyx_space.orbit_determination"))] -pub struct EpochRanges { +pub struct Strand { #[serde(serialize_with = "epoch_to_str", deserialize_with = "epoch_from_str")] pub start: Epoch, #[serde(serialize_with = "epoch_to_str", deserialize_with = "epoch_from_str")] pub end: Epoch, } -impl EpochRanges { +impl Strand { /// Returns whether the provided epoch is within the range pub fn contains(&self, epoch: Epoch) -> bool { (self.start..=self.end).contains(&epoch) @@ -179,21 +179,21 @@ mod trkconfig_ut { let start = Epoch::now().unwrap(); let end = start + 10.seconds(); - cfg.strands = Some(vec![EpochRanges { start, end }]); + cfg.strands = Some(vec![Strand { start, end }]); assert!( cfg.sanity_check().is_err(), "strand of too short of a duration should mark this insane" ); let end = start + cfg.sampling; - cfg.strands = Some(vec![EpochRanges { start, end }]); + cfg.strands = Some(vec![Strand { start, end }]); assert!( cfg.sanity_check().is_ok(), "strand allowing for a single measurement should be OK" ); // An anti-chronological strand should be invalid - cfg.strands = Some(vec![EpochRanges { + cfg.strands = Some(vec![Strand { start: end, end: start, }]); diff --git a/src/python/orbit_determination/scheduler.rs b/src/python/orbit_determination/scheduler.rs index 38f5eb16..1c3844ae 100644 --- a/src/python/orbit_determination/scheduler.rs +++ b/src/python/orbit_determination/scheduler.rs @@ -16,7 +16,7 @@ along with this program. If not, see . */ pub use crate::io::ConfigError; -pub use crate::od::simulator::{Cadence, EpochRanges, Handoff, Scheduler}; +pub use crate::od::simulator::{Cadence, Handoff, Scheduler, Strand}; use crate::NyxError; use hifitime::Duration; use pyo3::basic::CompareOp; diff --git a/src/python/orbit_determination/trkconfig.rs b/src/python/orbit_determination/trkconfig.rs index 5a76c146..64c47c2a 100644 --- a/src/python/orbit_determination/trkconfig.rs +++ b/src/python/orbit_determination/trkconfig.rs @@ -16,7 +16,7 @@ along with this program. If not, see . */ pub use crate::io::ConfigError; -pub use crate::od::simulator::{EpochRanges, Scheduler, TrkConfig}; +pub use crate::od::simulator::{Scheduler, Strand, TrkConfig}; use crate::{io::ConfigRepr, NyxError}; use hifitime::Duration; use pyo3::basic::CompareOp; @@ -47,7 +47,7 @@ impl TrkConfig { #[pyo3(text_signature = "(sampling=None, strands=None, scheduler=None)")] fn py_new( sampling: Option, - strands: Option>, + strands: Option>, scheduler: Option, ) -> Result { let mut me = Self::default(); diff --git a/tests/orbit_determination/resid_reject.rs b/tests/orbit_determination/resid_reject.rs index b571f708..85b1b6cd 100644 --- a/tests/orbit_determination/resid_reject.rs +++ b/tests/orbit_determination/resid_reject.rs @@ -79,7 +79,7 @@ fn devices_n_configs(epoch: Epoch) -> (Vec, HashMap, devices: Vec) { // Build a tracking config that should always see this vehicle. let trkcfg_always = TrkConfig::builder() - .strands(vec![EpochRanges { + .strands(vec![Strand { start: traj.first().epoch(), end: traj.last().epoch(), }]) @@ -216,7 +216,7 @@ fn trkconfig_zero_inclusion(traj: Traj, devices: Vec) { fn trkconfig_invalid(traj: Traj, devices: Vec) { // Build a tracking config where the exclusion range is less than the sampling rate let trkcfg = TrkConfig::builder() - .strands(vec![EpochRanges { + .strands(vec![Strand { start: traj.first().epoch(), end: traj.first().epoch(), }]) @@ -237,7 +237,7 @@ fn trkconfig_delayed_start(traj: Traj, devices: Vec) { let cosm = Cosm::de438(); let trkcfg = TrkConfig::builder() - .strands(vec![EpochRanges { + .strands(vec![Strand { start: traj.first().epoch() + 2.hours(), end: traj.last().epoch(), }])