Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breaking changes: runtime filtering of measurements and selection of processing for simultaneous measurements #379

Merged
merged 39 commits into from
Dec 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
7ee8169
Initial work on new tracking arc and measurement serialization.
ChristopherRabotin Nov 19, 2024
3d60740
Usability improvements to new generic tracking data arc
ChristopherRabotin Nov 21, 2024
105a0cb
Computation of sensitivity in new framework
ChristopherRabotin Nov 21, 2024
9aa07c0
Time to test this new sensitivity formulation
ChristopherRabotin Nov 21, 2024
c271300
Superb! Sensitivity matrix computation matches previous computation
ChristopherRabotin Nov 21, 2024
6aca68f
Impl snafu for measurement type
ChristopherRabotin Nov 21, 2024
e536886
Simulated measurements now match the original version
ChristopherRabotin Nov 22, 2024
5c22717
Finish refactoring OD processor for new measurement structure
ChristopherRabotin Nov 23, 2024
3aa4fb8
Add specific tests to the coverage report
ChristopherRabotin Nov 23, 2024
52a4163
Move ground station to its own module for maintainability
ChristopherRabotin Nov 23, 2024
1afddb0
Merge branch 'master' into feat/gh-333-od-msr-jit-filtering
ChristopherRabotin Nov 23, 2024
baf92ae
Switch to serde_yml
ChristopherRabotin Nov 23, 2024
b1eb2d7
Remove unused rust-embed
ChristopherRabotin Nov 23, 2024
bbf019f
WIP az/el
ChristopherRabotin Nov 23, 2024
62b7e78
Ground station stochastics now indexmap instead of explicit
ChristopherRabotin Nov 23, 2024
b162282
Fix LRO ground network
ChristopherRabotin Nov 23, 2024
2bc2fb1
Trying to debug the gs ut on github actions
ChristopherRabotin Nov 23, 2024
81de67c
Again
ChristopherRabotin Nov 23, 2024
5103c8f
Fix trkconfig previously with walagen unwraps
ChristopherRabotin Nov 23, 2024
79e808d
Add two tests to coverage + fix LRO ground station config
ChristopherRabotin Nov 23, 2024
af0cf16
Fix coverage report building
ChristopherRabotin Nov 23, 2024
6b447da
Fix singular noise matrix if only one measurement type is used.
ChristopherRabotin Nov 24, 2024
e882b43
Support az/el in OD (manual test with LRO example)
ChristopherRabotin Nov 24, 2024
6830def
Fix reloading of parquet in one way ekf test
ChristopherRabotin Nov 24, 2024
9a29b16
WIP support for az/el in tracking data reloading
ChristopherRabotin Nov 24, 2024
a3dc3e1
WIP variable size simultaneous KF processing
ChristopherRabotin Nov 24, 2024
6927ec3
Fix eporting residuals with all measurement types
ChristopherRabotin Nov 25, 2024
9cc143f
Status:
ChristopherRabotin Nov 25, 2024
3881e21
Fixed sensitivity of azimuth/elevation + fixed duplicates in export
ChristopherRabotin Nov 28, 2024
6c3fd08
Debugging in progress
ChristopherRabotin Nov 29, 2024
63006e1
Still debugging ... status follows
ChristopherRabotin Dec 1, 2024
82db8c0
Better prefit ratio computation
ChristopherRabotin Dec 1, 2024
ab832ac
Add h tilde verification test, looks decent
ChristopherRabotin Dec 2, 2024
dfa3cf5
Az/el measurement types work, but noisy
ChristopherRabotin Dec 2, 2024
0937fe7
Cleanup az/el msr types
ChristopherRabotin Dec 2, 2024
23d243e
Compute the Cholesky decomposition of the R_k matrix for the correct …
ChristopherRabotin Dec 8, 2024
37fcbb2
Add QQ plot
ChristopherRabotin Dec 8, 2024
9c22b15
Reenable obstruction in tracking data
ChristopherRabotin Dec 8, 2024
1ec99a9
Fix OD residual plotting + clippy
ChristopherRabotin Dec 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading