Skip to content

Commit

Permalink
Merge pull request #379 from nyx-space/feat/gh-333-od-msr-jit-filtering
Browse files Browse the repository at this point in the history
Breaking changes: runtime filtering of measurements and selection of processing for simultaneous measurements
  • Loading branch information
ChristopherRabotin authored Dec 8, 2024
2 parents 0f7d266 + 1ec99a9 commit 16c4448
Show file tree
Hide file tree
Showing 81 changed files with 3,677 additions and 2,886 deletions.
51 changes: 0 additions & 51 deletions .github/workflows/coverage.yaml

This file was deleted.

41 changes: 40 additions & 1 deletion .github/workflows/rust.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,11 @@ jobs:
restore-keys: ${{ runner.os }}-cargo-

- name: Unit Test (debug)
run: cargo test --lib
run: |
cat /home/runner/work/nyx/nyx/data/tests/config/many_ground_stations.yaml
cat /home/runner/work/nyx/nyx/data/tests/config/one_ground_station.yaml
ls -lh /home/runner/work/nyx/nyx/data/tests/config/
cargo test --lib
- name: All integration tests (release)
run: cargo test --release --test "*"
Expand All @@ -89,6 +93,41 @@ jobs:
cargo build --example 03_geo_raise --release
cargo build --example 03_geo_sk --release
coverage:
name: Unit test and integration test coverage analysis
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install stable toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: rustfmt, clippy

- name: Download data
run: |
wget -O data/de440s.bsp http://public-data.nyxspace.com/anise/de440s.bsp
wget -O data/de440s.bsp http://public-data.nyxspace.com/anise/de438.bsp # GMAT validation cases
wget -O data/pck08.pca http://public-data.nyxspace.com/anise/v0.4/pck08.pca
wget -O data/earth_latest_high_prec.bpc http://public-data.nyxspace.com/anise/ci/earth_latest_high_prec-2023-09-08.bpc
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Generate full code coverage
run: |
cargo llvm-cov test --release --lib --no-report
cargo llvm-cov test --release cov_test --no-report
cargo llvm-cov report --release --lcov --output-path lcov.info
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
files: lcov.info
fail_ci_if_error: false

lints:
name: Lints
runs-on: ubuntu-latest
Expand Down
7 changes: 3 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ gitlab = { repository = "nyx-space/nyx", branch = "master" }
nalgebra = "0.33"
log = "0.4"
hifitime = "4.0.0"
# anise = "0.5.0" # UNRELEASED
anise = { git = "https://github.com/nyx-space/anise.git", branch = "master" }
anise = "0.5.0"
flate2 = { version = "1.0", features = [
"rust_backend",
], default-features = false }
Expand All @@ -50,7 +49,6 @@ hyperdual = "1.3.0"
bytes = "1.0"
rand = "0.8"
rand_distr = "0.4"
rust-embed = "8"
regex = "1.5"
rayon = "1.6"
lazy_static = "1.4.0"
Expand All @@ -64,7 +62,7 @@ parquet = { version = "53.0.0", default-features = false, features = [
] }
arrow = "53.0.0"
shadow-rs = { version = "0.36.0", default-features = false }
serde_yaml = "0.9.21"
serde_yml = "0.0.12"
whoami = "1.3.0"
either = { version = "1.8.1", features = ["serde"] }
num = "0.4.0"
Expand All @@ -73,6 +71,7 @@ getrandom = { version = "0.2", features = ["js"] }
typed-builder = "0.20.0"
snafu = { version = "0.8.3", features = ["backtrace"] }
serde_dhall = "0.12"
indexmap = {version = "2.6.0", features = ["serde"]}


[dev-dependencies]
Expand Down
40 changes: 24 additions & 16 deletions data/tests/config/many_ground_stations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,22 @@
mu_km3_s2: 398600.435436096
shape: null
elevation_mask_deg: 5.0
range_noise_km:
bias:
tau: 24 h
process_noise: 5.0e-3 # 5 m
doppler_noise_km_s:
bias:
tau: 24 h
process_noise: 50.0e-6 # 5 cm/s
stochastic_noises:
range_km:
bias:
tau: 24 h
process_noise: 5.0e-3 # 5 m
doppler_km_s:
bias:
tau: 24 h
process_noise: 50.0e-6 # 5 cm/s
light_time_correction: false
latitude_deg: 2.3522
longitude_deg: 48.8566
height_km: 0.4
measurement_types:
- range_km
- doppler_km_s

- name: Canberra
frame:
Expand All @@ -28,12 +32,16 @@
longitude_deg: 148.981944
height_km: 0.691750
elevation_mask_deg: 5.0
range_noise_km:
bias:
tau: 24 h
process_noise: 5.0e-3 # 5 m
doppler_noise_km_s:
bias:
tau: 24 h
process_noise: 50.0e-6 # 5 cm/s
stochastic_noises:
range_km:
bias:
tau: 24 h
process_noise: 5.0e-3 # 5 m
doppler_km_s:
bias:
tau: 24 h
process_noise: 50.0e-6 # 5 cm/s
light_time_correction: false
measurement_types:
- range_km
- doppler_km_s
21 changes: 13 additions & 8 deletions data/tests/config/one_ground_station.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,17 @@ elevation_mask_deg: 5.0
latitude_deg: 2.3522
longitude_deg: 48.8566
height_km: 0.4
range_noise_km:
bias:
tau: 24 h
process_noise: 5.0e-3 # 5 m
doppler_noise_km_s:
bias:
tau: 24 h
process_noise: 50.0e-6 # 5 cm/s
stochastic_noises:
range_km:
bias:
tau: 24 h
process_noise: 5.0e-3 # 5 m
doppler_km_s:
bias:
tau: 24 h
process_noise: 50.0e-6 # 5 cm/s
light_time_correction: false
measurement_types:
- range_km
- doppler_km_s
integration_time: 1 min
12 changes: 8 additions & 4 deletions examples/02_jwst_covar_monte_carlo/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ use nyx::{
dynamics::{guidance::LocalFrame, OrbitalDynamics, SolarPressure, SpacecraftDynamics},
io::ExportCfg,
mc::MonteCarlo,
od::{prelude::KF, process::SpacecraftUncertainty, SpacecraftODProcess},
od::{msr::TrackingDataArc, prelude::KF, process::SpacecraftUncertainty, SpacecraftODProcess},
propagators::Propagator,
Spacecraft, State,
};

use std::{error::Error, sync::Arc};
use std::{collections::BTreeMap, error::Error, sync::Arc};

fn main() -> Result<(), Box<dyn Error>> {
pel::init();
Expand Down Expand Up @@ -116,13 +116,17 @@ fn main() -> Result<(), Box<dyn Error>> {

// Build the propagation instance for the OD process.
let prop = setup.with(jwst.with_stm(), almanac.clone());
let mut odp = SpacecraftODProcess::ckf(prop, ckf, None, almanac.clone());
let mut odp = SpacecraftODProcess::ckf(prop, ckf, BTreeMap::new(), None, almanac.clone());

// Define the prediction step, i.e. how often we want to know the covariance.
let step = 1_i64.minutes();
// Finally, predict, and export the trajectory with covariance to a parquet file.
odp.predict_for(step, prediction_duration)?;
odp.to_parquet("./02_jwst_covar_map.parquet", ExportCfg::default())?;
odp.to_parquet(
&TrackingDataArc::default(),
"./02_jwst_covar_map.parquet",
ExportCfg::default(),
)?;

// === Monte Carlo framework ===
// Nyx comes with a complete multi-threaded Monte Carlo frame. It's blazing fast.
Expand Down
4 changes: 2 additions & 2 deletions examples/03_geo_analysis/stationkeeping.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use nyx::{
Harmonics, OrbitalDynamics, SolarPressure, SpacecraftDynamics,
},
io::{gravity::HarmonicsMem, ExportCfg},
mc::{MonteCarlo, MultivariateNormal, StateDispersion},
mc::{MonteCarlo, MvnSpacecraft, StateDispersion},
md::{prelude::Objective, StateParameter},
propagators::{ErrorControl, IntegratorOptions, Propagator},
Spacecraft, State,
Expand Down Expand Up @@ -88,7 +88,7 @@ fn main() -> Result<(), Box<dyn Error>> {
// Let's start by defining the dispersion.
// The MultivariateNormal structure allows us to define the dispersions in any of the orbital parameters, but these are applied directly in the Cartesian state space.
// Note that additional validation on the MVN is in progress -- https://github.com/nyx-space/nyx/issues/339.
let mc_rv = MultivariateNormal::new(
let mc_rv = MvnSpacecraft::new(
sc,
vec![StateDispersion::zero_mean(StateParameter::SMA, 3.0)],
)?;
Expand Down
75 changes: 45 additions & 30 deletions examples/04_lro_od/dsn-network.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,30 @@
- name: DSS-65 Madrid
DSS-65 Madrid:
name: DSS-65 Madrid
frame:
ephemeris_id: 399
orientation_id: 399
mu_km3_s2: 398600.435436096
shape: null
elevation_mask_deg: 5.0
range_noise_km:
white_noise:
mean: 0.0
sigma: 5.0e-3 # 5 m
doppler_noise_km_s:
white_noise:
mean: 0.0
sigma: 50.0e-6 # 5 cm/s
light_time_correction: false
stochastic_noises:
range_km:
white_noise:
mean: 0.0
sigma: 5.0e-3 # 5 m
doppler_km_s:
white_noise:
mean: 0.0
sigma: 50.0e-6 # 5 cm/s
light_time_correction: true
latitude_deg: 40.427222
longitude_deg: 4.250556
height_km: 0.834939
measurement_types:
- range_km
- doppler_km_s

- name: DSS-34 Canberra
DSS-34 Canberra:
name: DSS-34 Canberra
frame:
ephemeris_id: 399
orientation_id: 399
Expand All @@ -28,17 +34,22 @@
longitude_deg: 148.981944
height_km: 0.691750
elevation_mask_deg: 5.0
range_noise_km:
white_noise:
mean: 0.0
sigma: 5.0e-3 # 5 m
doppler_noise_km_s:
white_noise:
mean: 0.0
sigma: 50.0e-6 # 5 cm/s
light_time_correction: false
stochastic_noises:
range_km:
white_noise:
mean: 0.0
sigma: 5.0e-3 # 5 m
doppler_km_s:
white_noise:
mean: 0.0
sigma: 50.0e-6 # 5 cm/s
light_time_correction: true
measurement_types:
- range_km
- doppler_km_s

- name: DSS-13 Goldstone
DSS-13 Goldstone:
name: DSS-13 Goldstone
frame:
ephemeris_id: 399
orientation_id: 399
Expand All @@ -48,12 +59,16 @@
longitude_deg: 243.205
height_km: 1.071149
elevation_mask_deg: 5.0
range_noise_km:
white_noise:
mean: 0.0
sigma: 5.0e-3 # 5 m
doppler_noise_km_s:
white_noise:
mean: 0.0
sigma: 50.0e-6 # 5 cm/s
light_time_correction: false
stochastic_noises:
range_km:
white_noise:
mean: 0.0
sigma: 5.0e-3 # 5 m
doppler_km_s:
white_noise:
mean: 0.0
sigma: 50.0e-6 # 5 cm/s
light_time_correction: true
measurement_types:
- range_km
- doppler_km_s
Loading

0 comments on commit 16c4448

Please sign in to comment.