helgee / JPLEphemeris.jl

JPL ephemerides for Julia
https://juliaastrodynamics.github.io/
Other
40 stars 12 forks source link

KeyError for some bodies #10

Closed crbinz closed 8 years ago

crbinz commented 8 years ago

Not sure if this is something that I'm doing wrong, but I get a KeyError: ### not found when I try to get position for certain bodies:

julia> position(spk,"sun",jd)
3-element Array{Float64,1}:
     5.59179e5
     2.0208e5
 61317.1

julia> position(spk,"mercury",jd)
ERROR: KeyError: 199 not found
 in position at /Users/cbinz/.julia/v0.4/JPLEphemeris/src/spk.jl:163
 in position at /Users/cbinz/.julia/v0.4/JPLEphemeris/src/spk.jl:168

julia> position(spk,"moon",jd)
ERROR: KeyError: 301 not found
 in position at /Users/cbinz/.julia/v0.4/JPLEphemeris/src/spk.jl:163
 in position at /Users/cbinz/.julia/v0.4/JPLEphemeris/src/spk.jl:168

julia> position(spk,"venus",jd)
ERROR: KeyError: 299 not found
 in position at /Users/cbinz/.julia/v0.4/JPLEphemeris/src/spk.jl:163
 in position at /Users/cbinz/.julia/v0.4/JPLEphemeris/src/spk.jl:168
helgee commented 8 years ago

This is expected. The "target-only" method uses the solar system's barycenter as the origin and the vectors for the bodies above are defined w.r.t. their respective planetary system's barycenters, e.g. position(spk,"mercury barycenter", "mercury",jd) works.

I should add a method that prints the possible combinations, though.

helgee commented 8 years ago

You can now list the available segments with print_segments(spk).

crbinz commented 8 years ago

I suspected this was more of a case of user error - sorry for the noise. print_segments is very useful!