Skip to content

Commit

Permalink
Disable Meeus by default (for the tests), and added Meeus test.
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristopherRabotin committed Apr 19, 2017
1 parent 956c3cd commit 7a34f08
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions celestial_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,16 @@ func TestCosmoBodyChange(t *testing.T) {
os.Remove(fmt.Sprintf("%s/prop-%s-1.xyzv", os.Getenv("DATAOUT"), conf.Filename))
os.Remove(fmt.Sprintf("%s/catalog-%s.json", os.Getenv("DATAOUT"), conf.Filename))
}

func TestMeeus(t *testing.T) {
meeusconfig := smdConfig()
meeusconfig.meeus = true
config = meeusconfig
R := Earth.HelioOrbit(julian.JDToTime(2456346.2539)).R()
exp := []float64{-0.146377664880867e8, -1.485144921336979e8, -0.000000771092830e8}
for i := 0; i < 3; i++ {
if !floats.EqualWithinAbs(R[i], exp[i], 1e-6) {
t.Fatalf("delta[%d] = %f km", i, math.Abs(R[i]-exp[i]))
}
}
}
2 changes: 1 addition & 1 deletion conf.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ output_path = "./" # Defines the output directory. Use "./" to output to current
test_export = false # Set to true to export the test cases.

[Meeus]
enabled = true # Will superseed any SPICE configuration.
enabled = false # Will superseed any SPICE configuration.

[SPICE]
directory = "./cmd/refframes"
Expand Down

0 comments on commit 7a34f08

Please sign in to comment.