Skip to content

Commit c2845b4

Browse files
Rename EpochRange to Strand
1 parent 5dce943 commit c2845b4

File tree

8 files changed

+20
-20
lines changed

8 files changed

+20
-20
lines changed

src/od/simulator/arc.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pub use crate::dynamics::{Dynamics, NyxError};
2525
use crate::io::ConfigError;
2626
use crate::md::trajectory::Interpolatable;
2727
use crate::od::msr::{RangeDoppler, TrackingArc};
28-
use crate::od::prelude::EpochRanges;
28+
use crate::od::prelude::Strand;
2929
use crate::od::simulator::Cadence;
3030
use crate::od::{GroundStation, Measurement};
3131
pub use crate::{cosmic::Cosm, State, TimeTagged};
@@ -322,7 +322,7 @@ impl TrackingArcSim<Orbit, RangeDoppler, GroundStation> {
322322
continue;
323323
}
324324

325-
let mut strand_range = EpochRanges {
325+
let mut strand_range = Strand {
326326
start: strand_start,
327327
end: strand_end,
328328
};
@@ -464,7 +464,7 @@ impl TrackingArcSim<Spacecraft, RangeDoppler, GroundStation> {
464464
traj.find_bracketed(start_at + 1.0_f64.seconds(), end_at, &device)
465465
{
466466
let strand_end = visibility_event.state.epoch();
467-
let mut strand_range = EpochRanges {
467+
let mut strand_range = Strand {
468468
start: start_at,
469469
end: strand_end,
470470
};

src/od/simulator/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ pub use scheduler::{Cadence, Handoff, Scheduler};
2525
mod trackdata;
2626
pub use trackdata::TrackingDeviceSim;
2727
mod trkconfig;
28-
pub use trkconfig::{EpochRanges, TrkConfig};
28+
pub use trkconfig::{Strand, TrkConfig};

src/od/simulator/trkconfig.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ pub struct TrkConfig {
5252
pub sampling: Duration,
5353
/// List of tracking strands during which the given tracker will be tracking
5454
#[builder(default, setter(strip_option))]
55-
pub strands: Option<Vec<EpochRanges>>,
55+
pub strands: Option<Vec<Strand>>,
5656
}
5757

5858
impl ConfigRepr for TrkConfig {}
@@ -133,18 +133,18 @@ impl Default for TrkConfig {
133133
}
134134
}
135135

136-
/// Stores an epoch range for tracking.
136+
/// Stores a tracking strand with a start and end epoch
137137
#[derive(Copy, Clone, Debug, Serialize, Deserialize, PartialEq)]
138138
#[cfg_attr(feature = "python", pyclass)]
139139
#[cfg_attr(feature = "python", pyo3(module = "nyx_space.orbit_determination"))]
140-
pub struct EpochRanges {
140+
pub struct Strand {
141141
#[serde(serialize_with = "epoch_to_str", deserialize_with = "epoch_from_str")]
142142
pub start: Epoch,
143143
#[serde(serialize_with = "epoch_to_str", deserialize_with = "epoch_from_str")]
144144
pub end: Epoch,
145145
}
146146

147-
impl EpochRanges {
147+
impl Strand {
148148
/// Returns whether the provided epoch is within the range
149149
pub fn contains(&self, epoch: Epoch) -> bool {
150150
(self.start..=self.end).contains(&epoch)
@@ -179,21 +179,21 @@ mod trkconfig_ut {
179179

180180
let start = Epoch::now().unwrap();
181181
let end = start + 10.seconds();
182-
cfg.strands = Some(vec![EpochRanges { start, end }]);
182+
cfg.strands = Some(vec![Strand { start, end }]);
183183
assert!(
184184
cfg.sanity_check().is_err(),
185185
"strand of too short of a duration should mark this insane"
186186
);
187187

188188
let end = start + cfg.sampling;
189-
cfg.strands = Some(vec![EpochRanges { start, end }]);
189+
cfg.strands = Some(vec![Strand { start, end }]);
190190
assert!(
191191
cfg.sanity_check().is_ok(),
192192
"strand allowing for a single measurement should be OK"
193193
);
194194

195195
// An anti-chronological strand should be invalid
196-
cfg.strands = Some(vec![EpochRanges {
196+
cfg.strands = Some(vec![Strand {
197197
start: end,
198198
end: start,
199199
}]);

src/python/orbit_determination/scheduler.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
along with this program. If not, see <https://www.gnu.org/licenses/>.
1717
*/
1818
pub use crate::io::ConfigError;
19-
pub use crate::od::simulator::{Cadence, EpochRanges, Handoff, Scheduler};
19+
pub use crate::od::simulator::{Cadence, Handoff, Scheduler, Strand};
2020
use crate::NyxError;
2121
use hifitime::Duration;
2222
use pyo3::basic::CompareOp;

src/python/orbit_determination/trkconfig.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
along with this program. If not, see <https://www.gnu.org/licenses/>.
1717
*/
1818
pub use crate::io::ConfigError;
19-
pub use crate::od::simulator::{EpochRanges, Scheduler, TrkConfig};
19+
pub use crate::od::simulator::{Scheduler, Strand, TrkConfig};
2020
use crate::{io::ConfigRepr, NyxError};
2121
use hifitime::Duration;
2222
use pyo3::basic::CompareOp;
@@ -47,7 +47,7 @@ impl TrkConfig {
4747
#[pyo3(text_signature = "(sampling=None, strands=None, scheduler=None)")]
4848
fn py_new(
4949
sampling: Option<String>,
50-
strands: Option<Vec<EpochRanges>>,
50+
strands: Option<Vec<Strand>>,
5151
scheduler: Option<Scheduler>,
5252
) -> Result<Self, ConfigError> {
5353
let mut me = Self::default();

tests/orbit_determination/resid_reject.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ fn devices_n_configs(epoch: Epoch) -> (Vec<GroundStation>, HashMap<String, TrkCo
7979
// Define the tracking configurations
8080
let mut configs = HashMap::new();
8181
let cfg = TrkConfig::builder()
82-
.strands(vec![EpochRanges {
82+
.strands(vec![Strand {
8383
start: epoch + 60.seconds(),
8484
end: epoch + 2.hours(),
8585
}])

tests/orbit_determination/spacecraft.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ fn od_val_sc_mb_srp_reals_duals_models() {
6363
// Define the tracking configurations
6464
let mut configs = HashMap::new();
6565
let cfg = TrkConfig::builder()
66-
.strands(vec![EpochRanges {
66+
.strands(vec![Strand {
6767
start: epoch,
6868
end: epoch + prop_time,
6969
}])

tests/orbit_determination/trackingarc.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use nyx_space::md::prelude::*;
44
use nyx_space::od::msr::RangeDoppler;
55
use nyx_space::od::prelude::*;
66
use nyx_space::od::simulator::TrackingArcSim;
7-
use nyx_space::od::simulator::{Cadence, EpochRanges, TrkConfig};
7+
use nyx_space::od::simulator::{Cadence, Strand, TrkConfig};
88
use rstest::*;
99
use std::collections::HashMap;
1010
use std::env;
@@ -185,7 +185,7 @@ fn trkconfig_zero_inclusion(traj: Traj<Orbit>, devices: Vec<GroundStation>) {
185185

186186
// Build a tracking config that should always see this vehicle.
187187
let trkcfg_always = TrkConfig::builder()
188-
.strands(vec![EpochRanges {
188+
.strands(vec![Strand {
189189
start: traj.first().epoch(),
190190
end: traj.last().epoch(),
191191
}])
@@ -216,7 +216,7 @@ fn trkconfig_zero_inclusion(traj: Traj<Orbit>, devices: Vec<GroundStation>) {
216216
fn trkconfig_invalid(traj: Traj<Orbit>, devices: Vec<GroundStation>) {
217217
// Build a tracking config where the exclusion range is less than the sampling rate
218218
let trkcfg = TrkConfig::builder()
219-
.strands(vec![EpochRanges {
219+
.strands(vec![Strand {
220220
start: traj.first().epoch(),
221221
end: traj.first().epoch(),
222222
}])
@@ -237,7 +237,7 @@ fn trkconfig_delayed_start(traj: Traj<Orbit>, devices: Vec<GroundStation>) {
237237
let cosm = Cosm::de438();
238238

239239
let trkcfg = TrkConfig::builder()
240-
.strands(vec![EpochRanges {
240+
.strands(vec![Strand {
241241
start: traj.first().epoch() + 2.hours(),
242242
end: traj.last().epoch(),
243243
}])

0 commit comments

Comments
 (0)