Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MethodError: no method matching position(::SPK, ::String, ::Float64) #22

Open
hjy1210 opened this issue Jan 21, 2021 · 0 comments
Open

Comments

@hjy1210
Copy link

hjy1210 commented Jan 21, 2021

Following the usage section in documentation

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant