HorizonsEphemeris.jl

A wrapper around a wrapper around the JPL Horizons API!
Author cadojo
Popularity
1 Star
Updated Last
10 Months Ago
Started In
April 2023

Tests Docs SciML Code Style

HorizonsEphemeris

A wrapper around the wrapper around JPL's REST API for the HORIZONS solar system ephemeris platform!

Please consider all minor changes breaking until v1.0!

Warning

This package is not affiliated with or endorsed by NASA, JPL, Caltech, or any other organization! This is an independently written package by an astrodynamics hobbyist.

Installation

Choose one of the following two lines!

julia> ]add HorizonsEphemeris

julia> import Pkg; Pkg.add("HorizonsEphemeris");

Limitations

Note that JPL Horizons ephemeris accuracy for major planetary bodies in the solar system may have errors larger than 1000km at some times!

Usage

As of v0.1, only Cartesian vectors are supported. You can query the ephemeris function with any solar system body name, or NAIF code; HorizonsEphemeris uses SPICE under the hood to return the appropriate Horizons-compatible NAIF code. After providing the desired solar system body, specify the start time, stop time, and step size for which you want ephemeris data. You'll receive a NamedTuple in return. The labels for each key can be changed with the header keyword. For example, to get rid of the Unicode character keys, specify header=[:MJD, :Calendar, :X, :Y, :Z, :DX, :DY, :DZ]. This NamedTuple output is automatically compatible with DataFrames. Finally, use the file keyword argument to write the resulting ephemeris data, with labels, to a provided filename as a CSV file.

julia> using Plots, Dates, HorizonsEphemeris

julia> earth = let start = now() - Year(50), stop = now() + Year(50), step = Day(1)
           @time ephemeris("earth", start, stop, step; wrt="jupiter", units="AU-D");
       end
  # 6.376672 seconds (19.78 k allocations: 21.253 MiB)

julia> plot(
           earth.X, earth.Y;
           aspect_ratio = 1,
           linewidth = 1.5,
           border = :none,
           size = (600, 600),
           dpi = 200,
           grid = false,
           axis = nothing,
           title = "",
           label=:none,
           color = "green",
           background=:transparent,
       )

Used By Packages

No packages found.