nyx_space/od/process/
rejectcrit.rs

1/*
2    Nyx, blazing fast astrodynamics
3    Copyright (C) 2018-onwards Christopher Rabotin <christopher.rabotin@gmail.com>
4
5    This program is free software: you can redistribute it and/or modify
6    it under the terms of the GNU Affero General Public License as published
7    by the Free Software Foundation, either version 3 of the License, or
8    (at your option) any later version.
9
10    This program is distributed in the hope that it will be useful,
11    but WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13    GNU Affero General Public License for more details.
14
15    You should have received a copy of the GNU Affero General Public License
16    along with this program.  If not, see <https://www.gnu.org/licenses/>.
17*/
18
19use crate::io::ConfigRepr;
20use serde_derive::{Deserialize, Serialize};
21
22/// Reject measurements if the prefit is greater than the provided sigmas deviation from the measurement noise.
23///
24/// # Important
25/// Some software, like ODTK, processes each measurement as a scalar. Nyx processes the measurements together.
26/// As such, if the prefit on range is bad, then the Doppler measurement with the same time stamp will also be rejected.
27/// This leads to better convergence of the filter, and more appropriate results.
28#[derive(Copy, Clone, Debug, Serialize, Deserialize, PartialEq)]
29pub struct ResidRejectCrit {
30    /// Number of sigmas for a measurement to be considered an outlier.
31    pub num_sigmas: f64,
32}
33
34impl Default for ResidRejectCrit {
35    /// By default, a measurement is rejected if its prefit residual is greater the 3-sigma value of the measurement noise at that time step.
36    /// This corresponds to [1 chance in in 370](https://en.wikipedia.org/wiki/68%E2%80%9395%E2%80%9399.7_rule).
37    fn default() -> Self {
38        Self { num_sigmas: 3.0 }
39    }
40}
41
42impl ConfigRepr for ResidRejectCrit {}