You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
using JPLEphemeris
using Dates
using Printf
# Load the DE430 SPK kernel
spk = SPK("de430.bsp")
# List the available segments
print_segments(spk)
# 2016-01-01T00:00 in Julian days
jd = Dates.datetime2julian(DateTime(2016,1,1,0,0,0))
# Position of Earth's barycenter w.r.t. the Solar System's barycenter at 2016-01-01T00:00
# [km]
pos = position(spk, "earth barycenter", jd)
# Velocity of Earth w.r.t. Earth's barycentre at 2016-01-01T00:00
# [km/s]
vel = velocity(spk, "earth barycenter", "earth", jd)
# Compute the state vector (position and velocity) of Earth's barycenter (NAIF ID: 3)
# w.r.t. to the Solar System's barycenter (NAIF ID: 0) for a range of Julian days
st = state(spk, 0, 3, jd:jd+100)
I got following output with error
Solar System Barycenter (0) => Mercury Barycenter (1)
Solar System Barycenter (0) => Venus Barycenter (2)
Solar System Barycenter (0) => Earth Barycenter (3)
Solar System Barycenter (0) => Mars Barycenter (4)
Solar System Barycenter (0) => Jupiter Barycenter (5)
Solar System Barycenter (0) => Saturn Barycenter (6)
Solar System Barycenter (0) => Uranus Barycenter (7)
Solar System Barycenter (0) => Neptune Barycenter (8)
Solar System Barycenter (0) => Pluto Barycenter (9)
Solar System Barycenter (0) => Sun (10)
Mercury Barycenter (1) => Mercury (199)
Venus Barycenter (2) => Venus (299)
Earth Barycenter (3) => Luna (301)
Earth Barycenter (3) => Earth (399)
MethodError: no method matching position(::SPK, ::String, ::Float64)
Closest candidates are:
position(::AstroBase.Ephemerides.AbstractEphemeris, !Matched::AstroTime.Epochs.Epoch, !Matched::CelestialBody; kwargs...) at C:\Users\hjy\.julia\packages\AstroBase\LxXo1\src\Ephemerides\abstract.jl:83
position(::AstroBase.Ephemerides.AbstractEphemeris, !Matched::AstroTime.Epochs.Epoch, !Matched::CelestialBody, !Matched::CelestialBody; kwargs...) at C:\Users\hjy\.julia\packages\AstroBase\LxXo1\src\Ephemerides\abstract.jl:70
Stacktrace:
[1] top-level scope at In[1]:16
[2] include_string(::Function, ::Module, ::String, ::String) at .\loading.jl:1091
Environment:
Julia 1.5.3, Windows 10
The text was updated successfully, but these errors were encountered:
Following the usage section in documentation
I got following output with error
Environment:
Julia 1.5.3, Windows 10
The text was updated successfully, but these errors were encountered: