Skip to content

Commit

Permalink
Fixed OD TB validation with tracking arc
Browse files Browse the repository at this point in the history
Working on fixing the other ones which use the schedule. It's probably a change in the measurement generation that causes the issue.
  • Loading branch information
ChristopherRabotin committed Dec 22, 2023
1 parent 6a9be42 commit dc3250e
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 25 deletions.
18 changes: 8 additions & 10 deletions data/tests/config/trk_cfg_od_val_arc.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
Madrid:
strands:
- start: 2020-01-01 00:00:00 UTC
end: 2020-01-01 03:00:00 UTC
- start: 2020-01-01 00:00:00 TAI
end: 2020-01-01 03:00:00 TAI
sampling: 1 min

Canberra:
strands:
- start: 2020-01-01 15:00:00 UTC
end: 2020-01-01 17:00:00 UTC
- start: 2020-01-01 19:00:00 UTC
end: 2020-01-02 00:00:00 UTC
- start: 2020-01-01 02:40:00 TAI
end: 2020-01-01 07:00:00 TAI
sampling: 1 min

Goldstone:
strands:
- start: 2020-01-01 06:00:00 UTC
end: 2020-01-01 08:00:00 UTC
- start: 2020-01-01 09:00:00 UTC
end: 2020-01-01 12:00:00 UTC
- start: 2020-01-01 19:30:00 TAI
end: 2020-01-02 00:00:00 TAI
- start: 2020-01-01 09:00:00 TAI
end: 2020-01-01 12:00:00 TAI
sampling: 1 min
1 change: 0 additions & 1 deletion src/md/events/search.rs
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,6 @@ where
// If the first event isn't a rising edge, then we mark the start of the trajectory as a rising edge
let mut prev_rise = if events[0].edge != EventEdge::Rising {
let value = event.eval(self.first());

Some(EventDetails::new(*self.first(), value, event, self)?)
} else {
Some(events[0].clone())
Expand Down
4 changes: 2 additions & 2 deletions src/od/filter/kalman.rs
Original file line number Diff line number Diff line change
Expand Up @@ -372,12 +372,12 @@ where

if let Some(ratio_thresh) = resid_ratio_check {
if ratio > ratio_thresh {
warn!("{epoch} msr rejected: residual ratio {ratio} > {ratio_thresh}");
warn!("{epoch} msr rejected: residual ratio {ratio:.3e} > {ratio_thresh}");
// Perform only a time update and return
let pred_est = self.time_update(nominal_state)?;
return Ok((pred_est, Residual::rejected(epoch, prefit, ratio)));
} else {
debug!("{epoch} msr accepted: residual ratio {ratio} < {ratio_thresh}");
debug!("{epoch} msr accepted: residual ratio {ratio:.3e} < {ratio_thresh}");
}
}

Expand Down
11 changes: 10 additions & 1 deletion src/od/process/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,10 @@ where
// Start by propagating the estimator (on the same thread).
let num_msrs = measurements.len();

self.prop.set_step(max_step, self.prop.fixed_step);
// Update the step size of the navigation propagator if it isn't already fixed step
if !self.prop.fixed_step {
self.prop.set_step(max_step, false);
}

let prop_time = measurements[num_msrs - 1].1.epoch() - self.kf.previous_estimate().epoch();
info!("Navigation propagating for a total of {prop_time} with step size {max_step}");
Expand Down Expand Up @@ -512,6 +515,12 @@ where

let next_step_size = delta_t.min(self.prop.step_size);

// let next_step_size = delta_t.min(if self.prop.details.step.is_negative() {
// max_step
// } else {
// self.prop.details.step
// });

// Remove old states from the trajectory
// This is a manual implementation of `retaint` because we know it's a sorted vec, so no need to resort every time
let mut index = traj.states.len();
Expand Down
11 changes: 0 additions & 11 deletions tests/orbit_determination/two_body.rs
Original file line number Diff line number Diff line change
Expand Up @@ -454,11 +454,6 @@ fn od_tb_val_ckf_fixed_step_perfect_stations() {

odp.to_parquet(path, ExportCfg::default()).unwrap();

// Check that we have as many estimates as steps taken by the propagator.
// Note that this test cannot work when using a variable step propagator in that same setup.
// We're adding +1 because the propagation time is inclusive on both ends.
let expected_num_estimates = (prop_time.to_seconds() / step_size.to_seconds()) as usize + 1;

// Check that there are no duplicates of epochs.
let mut prev_epoch = odp.estimates[0].epoch();

Expand All @@ -471,12 +466,6 @@ fn od_tb_val_ckf_fixed_step_perfect_stations() {
prev_epoch = this_epoch;
}

assert_eq!(
odp.estimates.len(),
expected_num_estimates,
"Different number of estimates received"
);

for (no, est) in odp.estimates.iter().enumerate() {
if no == 0 {
// Skip the first estimate which is the initial estimate provided by user
Expand Down

0 comments on commit dc3250e

Please sign in to comment.