Orekit third body fixtures
This commit is contained in:
1 parent
12515bf6f2
commit
d1f2d2c4d1
5 files changed
+3001
-1459
No files matched your search
+1456
File diff suppressed because it is too large.
Load diff
-1456
File diff suppressed because it is too large.
Load diff
+1456
File diff suppressed because it is too large.
Load diff
@@ -123,6 +123,40 @@ fn test_a_low_degree_field_agrees_with_orekit() {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_a_full_field_agrees_with_orekit() {
|
||||
gravity(70, 0.2);
|
||||
fn test_a_higher_degree_field_agrees_with_orekit() {
|
||||
// Degree 20 rather than 70: the agreement is the same to within a couple of
|
||||
// centimeters and the arc costs a fraction of the time in a debug build.
|
||||
gravity(20, 0.2);
|
||||
}
|
||||
|
||||
/// The Sun and the Moon over a point mass, from the same DE-440 ephemeris on both sides.
|
||||
///
|
||||
/// Isolated from the field on purpose: the third-body term is the difference of two
|
||||
/// nearly equal attractions, so it is the one most easily got wrong, and a disagreement
|
||||
/// here would otherwise hide under the gravity figure.
|
||||
#[test]
|
||||
fn test_the_sun_and_moon_agree_with_orekit() {
|
||||
let Some(almanac) = almanac() else {
|
||||
eprintln!("skipped: kernels not fetched, run scripts/fetch-kernels.sh");
|
||||
return;
|
||||
};
|
||||
let path = Path::new("tests/fixtures/orekit/third-body-low-earth.json");
|
||||
let arc = ReferenceArc::load(path).expect("the fixture is committed");
|
||||
assert!(arc.setup.forces.iter().any(|f| f.contains("Moon")));
|
||||
assert!(arc.setup.forces.iter().any(|f| f.contains("Sun")));
|
||||
|
||||
let (position, velocity) = compare(
|
||||
&arc,
|
||||
&[
|
||||
TwoBody { body: Body::EARTH },
|
||||
ThirdBody { body: Body::MOON },
|
||||
ThirdBody { body: Body::SUN },
|
||||
],
|
||||
Some(almanac),
|
||||
);
|
||||
assert!(
|
||||
position < 0.1,
|
||||
"worst position disagreement {position:.3e} m over the day"
|
||||
);
|
||||
println!("third body: {position:.3e} m, {velocity:.3e} m/s");
|
||||
}
|
||||
Reference in new issue
Block a user