Skip to content

Commit

Permalink
LRO OD errors are still quite large
Browse files Browse the repository at this point in the history
- RIC errors are still quite large due to a modeling error
- Residuals are too large
  • Loading branch information
ChristopherRabotin committed Aug 15, 2024
1 parent 5a6377c commit 5648b9f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions examples/04_lro_od/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ extern crate pretty_env_logger as pel;
use anise::{
almanac::metaload::MetaFile,
constants::{
celestial_objects::{EARTH, SUN},
frames::{EARTH_J2000, IAU_MOON_FRAME, MOON_J2000, MOON_PA_FRAME},
celestial_objects::{EARTH, JUPITER_BARYCENTER, SUN},
frames::{EARTH_J2000, MOON_J2000, MOON_PA_FRAME},
},
};
use hifitime::{Epoch, TimeUnits, Unit};
Expand Down Expand Up @@ -114,8 +114,6 @@ fn main() -> Result<(), Box<dyn Error>> {

let configs: BTreeMap<String, TrkConfig> = TrkConfig::load_named(trkconfg_yaml)?;

dbg!(&configs);

// Build the tracking arc simulation to generate a "standard measurement".
let mut trk = TrackingArcSim::<Spacecraft, RangeDoppler, _>::with_seed(
devices,
Expand All @@ -139,7 +137,7 @@ fn main() -> Result<(), Box<dyn Error>> {

// Specify that the orbital dynamics must account for the graviational pull of the Earth and the Sun.
// The gravity of the Moon will also be accounted for since the spaceraft in a lunar orbit.
let mut orbital_dyn = OrbitalDynamics::point_masses(vec![EARTH, SUN]);
let mut orbital_dyn = OrbitalDynamics::point_masses(vec![EARTH, SUN, JUPITER_BARYCENTER]);

// We want to include the spherical harmonics, so let's download the gravitational data from the Nyx Cloud.
// We're using the GRAIL JGGRX model.
Expand All @@ -157,7 +155,7 @@ fn main() -> Result<(), Box<dyn Error>> {
// let moon_pa_frame = IAU_MOON_FRAME;
let sph_harmonics = Harmonics::from_stor(
almanac.frame_from_uid(moon_pa_frame)?,
HarmonicsMem::from_shadr(&jggrx_meta.uri, 500, 500, true)?,
HarmonicsMem::from_shadr(&jggrx_meta.uri, 80, 80, true)?,
);

// Include the spherical harmonics into the orbital dynamics.
Expand All @@ -166,7 +164,8 @@ fn main() -> Result<(), Box<dyn Error>> {
// We define the solar radiation pressure, using the default solar flux and accounting only
// for the eclipsing caused by the Earth and Moon.
// Note that by default, enabling the SolarPressure model will also enable the estimation of the coefficient of reflectivity.
let srp_dyn = SolarPressure::new(vec![EARTH_J2000, MOON_J2000], almanac.clone())?;
let srp_dyn =
SolarPressure::default_no_estimation(vec![EARTH_J2000, MOON_J2000], almanac.clone())?;

// Finalize setting up the dynamics, specifying the force models (orbital_dyn) separately from the
// acceleration models (SRP in this case). Use `from_models` to specify multiple accel models.
Expand Down Expand Up @@ -201,9 +200,10 @@ fn main() -> Result<(), Box<dyn Error>> {
// Until https://github.com/nyx-space/nyx/issues/351, we need to specify the SNC in the acceleration of the Moon J2000 frame.
let kf = KF::new(
initial_estimate,
SNC3::from_diagonal(2 * Unit::Minute, &[1e-13, 1e-13, 1e-13]),
SNC3::from_diagonal(2 * Unit::Minute, &[1e-16, 1e-16, 1e-16]),
);

// We'll set up the OD process to reject measurements whose residuals are mover than 4 sigmas away from what we expect.
let mut odp = ODProcess::ckf(setup.with(sc_seed, almanac.clone()), kf, None, almanac);

odp.process_arc::<GroundStation>(&arc)?;
Expand Down
4 changes: 2 additions & 2 deletions src/dynamics/solarpressure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ impl SolarPressure {

/// Accounts for the shadowing of only one body and will set the solar flux at 1 AU to: Phi = 1367.0
pub fn default_no_estimation(
shadow_body: Frame,
shadow_bodies: Vec<Frame>,
almanac: Arc<Almanac>,
) -> Result<Arc<Self>, DynamicsError> {
let mut srp = Self::default_raw(vec![shadow_body], almanac)?;
let mut srp = Self::default_raw(shadow_bodies, almanac)?;
srp.estimate = false;
Ok(Arc::new(srp))
}
Expand Down

0 comments on commit 5648b9f

Please sign in to comment.