helgee / JPLEphemeris.jl

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

velocity example in README fails #8

Closed crbinz closed 8 years ago

crbinz commented 8 years ago

I just tried walking through the README, but the velocity call throws an error:

julia> vel = velocity(spk, "mercury barycenter", "mercury", jd)
ERROR: BoundsError: attempt to access 2-element Array{Float64,1}:
 0.0
 1.0
  at index [3]
 in velocity at C:\Users\cbinz\.julia\v0.4\JPLEphemeris\src\spk.jl:168
 in velocity at C:\Users\cbinz\.julia\v0.4\JPLEphemeris\src\spk.jl:179
 in velocity at C:\Users\cbinz\.julia\v0.4\JPLEphemeris\src\spk.jl:184
 in velocity at C:\Users\cbinz\.julia\v0.4\JPLEphemeris\src\spk.jl:197
helgee commented 8 years ago

Confirmed. I haven't found out how I broke it, yet.

helgee commented 8 years ago

@crbinz Thanks for reporting this embarrassing issue! It prompted me to write a proper API test suite. I also chose a different example for the readme because the difference in position and velocity for Mercury w.r.t. to its barycenter is zero in DE430.

crbinz commented 8 years ago

Thanks for the quick fix!